/ .github / workflows / gh-pages.yml
gh-pages.yml
 1  name: github pages
 2  
 3  on:
 4    push:
 5      branches:
 6        - main
 7    pull_request:
 8  
 9  jobs:
10    deploy:
11      runs-on: ubuntu-20.04
12      concurrency:
13        group: ${{ github.workflow }}-${{ github.ref }}
14      steps:
15        - uses: actions/checkout@v2
16  
17        - name: Setup mdBook
18          uses: peaceiris/actions-mdbook@v1
19          with:
20            mdbook-version: 'latest'
21  
22        - run: |
23            cd doc
24            mdbook build
25  
26        - name: Deploy
27          uses: peaceiris/actions-gh-pages@v3
28          if: ${{ github.ref == 'refs/heads/main' }}
29          with:
30            github_token: ${{ secrets.GITHUB_TOKEN }}
31            publish_dir: ./doc/book