0.12 #5
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: Docs deploy | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: docs | |
| url: https://www.method-b.uk/pyStrich/docs/ | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: uv sync --frozen --no-default-groups --group docs | |
| - name: Build docs | |
| run: | | |
| uv run --frozen sphinx-build -W --keep-going -b doctest docs docs/_build/doctest | |
| uv run --frozen sphinx-build -W --keep-going -b text docs docs/_build/text | |
| uv run --frozen sphinx-build -W --keep-going -b html docs docs/_build/html | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Sync to S3 | |
| run: | | |
| aws s3 sync docs/_build/html/ "s3://${{ secrets.S3_BUCKET }}/pyStrich/docs/" --delete | |
| - name: Invalidate CloudFront | |
| run: | | |
| aws cloudfront create-invalidation \ | |
| --distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \ | |
| --paths "/pyStrich/docs/*" |