prepare for website #13
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: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/docs.yml" | |
| - "README.md" | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| - "pyproject.toml" | |
| - "tests/docs/**" | |
| - "tools/mkdocs_publication.py" | |
| pull_request: | |
| paths: | |
| - ".github/workflows/docs.yml" | |
| - "README.md" | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| - "pyproject.toml" | |
| - "tests/docs/**" | |
| - "tools/mkdocs_publication.py" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Install documentation dependencies | |
| run: python -m pip install -e ".[docs,qa]" | |
| - name: Run documentation tests | |
| run: python -m pytest -q tests/docs | |
| - name: Build reviewed documentation | |
| run: python -m mkdocs build --strict | |
| - name: Configure GitHub Pages | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| uses: actions/configure-pages@v5 | |
| - name: Upload GitHub Pages artifact | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: site | |
| deploy: | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Deploy GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |