| name: Deploy Documentation |
| |
| on: |
| push: |
| branches: |
| - master |
| paths: |
| - 'docs/**' # Trigger only when the source docs files are modified |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| build_and_deploy: |
| permissions: |
| contents: write # for peaceiris/actions-gh-pages to push pages branch |
| name: Build and deploy documentation |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| - name: Install dependencies |
| run: | |
| python -m pip install --upgrade pip |
| pip install sphinx sphinx_rtd_theme |
| - name: Build documentation |
| run: python -m sphinx docs build |
| - name: Deploy to GitHub Pages |
| uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 |
| with: |
| github_token: ${{ secrets.GITHUB_TOKEN }} |
| publish_branch: gh-pages |
| publish_dir: build |
| force_orphan: true |