Update publish-to-pypi.yml #93
Workflow file for this run
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: documentation | |
| on: | |
| push: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| doctest: | |
| name: Test if documentation can be rendered | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| with: | |
| version: "0.11.16" | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras | |
| - name: Run doctest | |
| run: uv run sphinx-build -b doctest doc . | |
| docdeploy: | |
| name: Render the documentation and push it to gh-pages | |
| runs-on: ubuntu-latest | |
| needs: doctest | |
| if: ${{github.ref == 'refs/heads/main'}} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| with: | |
| version: "0.11.16" | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras | |
| - name: Sphinx build | |
| run: uv run sphinx-build doc _build | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| publish_branch: gh-pages | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: _build/ | |
| force_orphan: true |