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 knowledge_books | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main # 或者你使用的其他主分支名 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Debug List files0 | |
| run: ls -lR "${GITHUB_WORKSPACE}/" | |
| - name: Debug List files1 | |
| run: ls -lR "${GITHUB_WORKSPACE}/.github/tools" | |
| - name: Install mdBook | |
| run: | | |
| chmod +x "${GITHUB_WORKSPACE}/.github/tools/mdbook" | |
| chmod +x "${GITHUB_WORKSPACE}/.github/tools/mdbook-katex" | |
| echo "${GITHUB_WORKSPACE}/.github/tools" >> $GITHUB_PATH | |
| - name: Verify mdbook version | |
| run: mdbook --version | |
| - name: Verify mdbook-katex version | |
| run: mdbook-katex --version | |
| - name: Build the book | |
| working-directory: book_template | |
| run: mdbook build | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: publish_books/book_template | |
| publish_branch: gh-pages # 你想部署的分支 | |
| cname: "yinghuochong" # 如果你使用自定义域名,可以填写 |