Deploy MkDocs to GitHub Pages #9
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 MkDocs to GitHub Pages | |
| # 👇 改为手动触发 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| reason: | |
| description: 'Build docs' | |
| required: false | |
| default: 'Manual deploy' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| pip install mkdocs | |
| pip install mkdocstrings-python | |
| pip install mkdocstrings | |
| pip install mkdocs-material | |
| - name: Build site | |
| run: | | |
| cd docs | |
| mkdocs build | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/site |