deploy-pages #2
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 site to GitHub Pages | |
| on: | |
| push: | |
| branches: ["deploy"] | |
| pull_request: | |
| repository_dispatch: | |
| types: [deploy-pages] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup mdBook | |
| uses: peaceiris/actions-mdbook@v1 | |
| with: | |
| mdbook-version: '0.5.0-beta.1' # 建议指定一个稳定版本 | |
| - name: Build with mdBook | |
| run: | | |
| mdbook clean | |
| mdbook build | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./book |