|
5 | 5 | branches: |
6 | 6 | - master |
7 | 7 |
|
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + id-token: write |
| 11 | + |
8 | 12 | jobs: |
9 | 13 | build: |
10 | 14 | runs-on: ubuntu-latest |
| 15 | + environment: docs |
11 | 16 | strategy: |
12 | 17 | matrix: |
13 | 18 | python-version: ['3.14'] |
@@ -60,17 +65,25 @@ jobs: |
60 | 65 | run: | |
61 | 66 | pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd |
62 | 67 |
|
63 | | - - name: Push documentation to S3 |
| 68 | + - name: Configure AWS Credentials |
64 | 69 | if: env.PUBLISH == 'true' |
65 | | - uses: jakejarvis/s3-sync-action@v0.5.1 |
| 70 | + uses: aws-actions/configure-aws-credentials@v4 |
66 | 71 | with: |
67 | | - args: --follow-symlinks --delete |
68 | | - env: |
69 | | - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
70 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
71 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
72 | | - AWS_REGION: 'us-west-1' # optional: defaults to us-east-1 |
73 | | - SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository |
| 72 | + role-to-assume: ${{ secrets.G_DOCS_ROLE_ARN }} |
| 73 | + aws-region: us-east-1 |
| 74 | + |
| 75 | + - name: Push documentation to S3 |
| 76 | + if: env.PUBLISH == 'true' |
| 77 | + run: | |
| 78 | + aws s3 sync docs/_build/html "s3://${{ secrets.G_DOCS_BUCKET }}" \ |
| 79 | + --delete --follow-symlinks |
| 80 | +
|
| 81 | + - name: Invalidate CloudFront |
| 82 | + if: env.PUBLISH == 'true' |
| 83 | + run: | |
| 84 | + aws cloudfront create-invalidation \ |
| 85 | + --distribution-id "${{ secrets.G_DOCS_DISTRIBUTION }}" \ |
| 86 | + --paths "/index.html" "/objects.inv" "/searchindex.js" |
74 | 87 |
|
75 | 88 | - name: Purge cache on Cloudflare |
76 | 89 | if: env.PUBLISH == 'true' |
|
0 commit comments