feat: prepare public 0.1.0 release #7
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: Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: docs-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Upgrade pip | |
| run: python -m pip install --upgrade pip | |
| - name: Install package | |
| run: python -m pip install -e . | |
| - name: Build Sphinx site | |
| run: python -m sphinx -W --keep-going -b html docs docs/_build/html | |
| - name: Pages not enabled yet | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && github.event.repository.has_pages != true | |
| run: | | |
| echo "GitHub Pages is not enabled for this repository yet." | |
| echo "The docs build succeeded, but deployment is skipped until Settings > Pages > Source is set to GitHub Actions." | |
| - name: Upload Pages artifact | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && github.event.repository.has_pages == true | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/_build/html | |
| deploy: | |
| name: Deploy docs | |
| needs: build | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && github.event.repository.has_pages == true | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pages: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |