patch #104
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
# Github Setup: | |
# 1. settings > pages > branch > pages/root | |
# 2. settings > actions > general > workflow permissions > read and write permissions | |
# 3. (optional) in `pages` branch create `index.html` with redirect to `/docs` | |
name: π Deploy Book | |
on: | |
push: | |
branches: main | |
paths: [ | |
'docs/**', | |
'.github/workflows/book.yml', | |
] | |
jobs: | |
deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: π¨ Install mdbook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: '0.4.34' | |
- name: π¨ Install mdbook-mermaid | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: mdbook-mermaid | |
version: '0.12.6' | |
- name: π¨ Build Book | |
run: mdbook build | |
working-directory: ./docs | |
- name: π Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: pages | |
publish_dir: ./docs/book | |
# destination_dir: docs |