theme(sidebar): Add django-search-query links (#67) #209
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 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: docs | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Filter changed file paths to outputs | |
| uses: dorny/paths-filter@v4 | |
| id: changes | |
| with: | |
| filters: | | |
| publishable: | |
| - 'README.*' | |
| - 'CHANGES' | |
| - 'docs/**' | |
| - 'packages/**' | |
| - 'scripts/ci/**' | |
| - '.github/workflows/docs.yml' | |
| - '.github/workflows/tests.yml' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - name: Set up Python 3.14 | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Install uv | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| # `gp-furo-theme`'s build backend (`sphinx_vite_builder.build`) | |
| # runs `pnpm exec vite build` during the `uv sync` editable | |
| # install below — populating the gitignored `static/` tree so | |
| # the docs build picks up real CSS / JS. pnpm + Node MUST be on | |
| # PATH before `uv sync` runs, or the backend fast-fails with | |
| # PnpmMissingError. Mirrors the ordering in tests.yml's docs job. | |
| - name: Set up pnpm | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - name: Set up Node | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install workspace dependencies | |
| if: steps.changes.outputs.publishable == 'true' | |
| run: uv sync --all-packages --all-extras --group dev | |
| - name: Install just | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: extractions/setup-just@v4 | |
| - name: Print Python versions | |
| if: steps.changes.outputs.publishable == 'true' | |
| run: | | |
| python -V | |
| uv run python -V | |
| - name: Cache sphinx fonts | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/sphinx-fonts | |
| key: sphinx-fonts-${{ hashFiles('docs/conf.py') }} | |
| restore-keys: | | |
| sphinx-fonts- | |
| - name: Build documentation | |
| if: steps.changes.outputs.publishable == 'true' | |
| run: uv run sphinx-build -W -b dirhtml docs docs/_build/html | |
| - name: Configure AWS Credentials | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ secrets.GP_SPHINX_DOCS_ROLE_ARN }} | |
| aws-region: us-east-1 | |
| - name: Push documentation to S3 | |
| if: steps.changes.outputs.publishable == 'true' | |
| run: | | |
| aws s3 sync docs/_build/html "s3://${{ secrets.GP_SPHINX_DOCS_BUCKET }}" \ | |
| --delete --follow-symlinks | |
| - name: Invalidate CloudFront | |
| if: steps.changes.outputs.publishable == 'true' | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id "${{ secrets.GP_SPHINX_DOCS_DISTRIBUTION }}" \ | |
| --paths "/index.html" "/objects.inv" "/searchindex.js" | |
| - name: Purge cache on Cloudflare | |
| if: steps.changes.outputs.publishable == 'true' | |
| uses: jakejarvis/cloudflare-purge-action@v0.3.0 | |
| env: | |
| CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | |
| CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} |