update mermaid #10
Workflow file for this run
This file contains hidden or 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 mdBook to GitHub Pages | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # 匹配版本标签 | |
| workflow_dispatch: # 保留手动触发,便于调试 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # 允许推送 gh-pages 分支 | |
| pages: write # 可选,若使用官方 pages 部署可开启 | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup mdBook | |
| uses: peaceiris/actions-mdbook@v2 | |
| with: | |
| mdbook-version: 'latest' | |
| # 安装二进制安装器并下载 mdbook-mermaid | |
| - name: Install mdbook-mermaid | |
| run: | | |
| curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| cargo binstall -y mdbook-mermaid | |
| - name: Build mdBook | |
| run: mdbook build book/ # 假设 book.toml 位于 book/ 目录 | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./book/book # mdBook 默认输出目录 | |
| publish_branch: gh-pages # GitHub Pages 目标分支 | |
| force_orphan: true # 保持提交历史干净 |