And publish from master too #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Book | |
on: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
build-book: | |
name: Build Book | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install mdbook | |
run: cargo install mdbook --version "^0.4" --locked | |
- name: Run mdbook | |
run: mdbook build doc | |
- name: Upload book | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: doc/book/ | |
retention-days: "3" | |
- name: Deploy Book | |
uses: JamesIves/github-pages-deploy-action@v4 | |
if: ${{ github.event_name == 'push' && (startsWith('refs/heads/main', github.ref) || startsWith('refs/heads/master', github.ref)) }} | |
with: | |
branch: gh-pages | |
folder: doc/book/ | |
single-commit: true |