docs(sphinx) Render demos at real size, not stretched #1207
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: | |
| - master | |
| - screen-recording-2026-07-12 # [DO NOT MERGE] temporary docs preview | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: docs | |
| strategy: | |
| matrix: | |
| python-version: ['3.14'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Filter changed file paths to outputs | |
| uses: dorny/paths-filter@v4.0.1 | |
| id: changes | |
| with: | |
| filters: | | |
| root_docs: | |
| - CHANGES | |
| - README.* | |
| docs: | |
| - 'docs/**' | |
| - 'docs/_static/demos/asciinema/*.gif' | |
| - 'examples/**' | |
| python_files: | |
| - 'src/vcspull/**' | |
| - pyproject.toml | |
| - uv.lock | |
| - name: Should publish | |
| # [DO NOT MERGE] force publish on the preview branch regardless of changed paths | |
| if: github.ref == 'refs/heads/screen-recording-2026-07-12' || github.event_name == 'workflow_dispatch' || steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true' | |
| run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| if: env.PUBLISH == 'true' | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| if: env.PUBLISH == 'true' | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| if: env.PUBLISH == 'true' | |
| run: uv sync --all-extras --dev | |
| - name: Install just | |
| if: env.PUBLISH == 'true' | |
| uses: extractions/setup-just@v4 | |
| - name: Print python versions | |
| if: env.PUBLISH == 'true' | |
| run: | | |
| python -V | |
| uv run python -V | |
| - name: Cache sphinx fonts | |
| if: env.PUBLISH == '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: env.PUBLISH == 'true' | |
| run: | | |
| cd docs && just html | |
| - name: Configure AWS Credentials | |
| if: env.PUBLISH == 'true' | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ secrets.VCSPULL_DOCS_ROLE_ARN }} | |
| aws-region: us-east-1 | |
| - name: Push documentation to S3 | |
| if: env.PUBLISH == 'true' | |
| run: | | |
| aws s3 sync docs/_build/html "s3://${{ secrets.VCSPULL_DOCS_BUCKET }}" \ | |
| --delete --follow-symlinks | |
| - name: Invalidate CloudFront | |
| if: env.PUBLISH == 'true' | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id "${{ secrets.VCSPULL_DOCS_DISTRIBUTION }}" \ | |
| --paths "/index.html" "/objects.inv" "/searchindex.js" | |
| - name: Purge cache on Cloudflare | |
| if: env.PUBLISH == 'true' | |
| uses: jakejarvis/cloudflare-purge-action@v0.3.0 | |
| env: | |
| CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | |
| CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} |