Optimize article layout #61
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: Build Sphinx Docs | |
| on: | |
| push: | |
| branches: [ main ] # 当 main 分支有更新时触发 | |
| pull_request: | |
| branches: [ main ] # 当有 PR 指向 main 分支时触发 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Clean | |
| run: make clean | |
| - name: Build HTML | |
| run: make html | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| # if: github.ref == 'refs/heads/main' | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: build/html | |
| publish_branch: gh-pages | |
| force_orphan: true |