build(justfile): Add recipe groups for organized listing #1117
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 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: docs | |
| strategy: | |
| matrix: | |
| python-version: ['3.14'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Filter changed file paths to outputs | |
| uses: dorny/paths-filter@v3.0.2 | |
| id: changes | |
| with: | |
| filters: | | |
| root_docs: | |
| - CHANGES | |
| - README.* | |
| docs: | |
| - 'docs/**' | |
| - 'examples/**' | |
| python_files: | |
| - 'libvcs/**' | |
| - pyproject.toml | |
| - uv.lock | |
| - name: Should publish | |
| if: 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 | |
| if: env.PUBLISH == 'true' | |
| uses: astral-sh/setup-uv@v7 | |
| 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 [w/ docs] | |
| if: env.PUBLISH == 'true' | |
| run: uv sync --all-extras --dev | |
| - name: Install just | |
| if: env.PUBLISH == 'true' | |
| uses: extractions/setup-just@v2 | |
| - 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@v4 | |
| with: | |
| role-to-assume: ${{ secrets.LIBVCS_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.LIBVCS_DOCS_BUCKET }}" \ | |
| --delete --follow-symlinks | |
| - name: Invalidate CloudFront | |
| if: env.PUBLISH == 'true' | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id "${{ secrets.LIBVCS_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 }} |