|
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'] |
@@ -52,17 +57,25 @@ jobs: |
52 | 57 | run: | |
53 | 58 | pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd |
54 | 59 |
|
55 | | - - name: Push documentation to S3 |
| 60 | + - name: Configure AWS Credentials |
56 | 61 | if: env.PUBLISH == 'true' |
57 | | - uses: jakejarvis/s3-sync-action@v0.5.1 |
| 62 | + uses: aws-actions/configure-aws-credentials@v4 |
58 | 63 | with: |
59 | | - args: --follow-symlinks --delete |
60 | | - env: |
61 | | - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} |
62 | | - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
63 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
64 | | - AWS_REGION: 'us-west-1' # optional: defaults to us-east-1 |
65 | | - SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository |
| 64 | + role-to-assume: ${{ secrets.LIBVCS_DOCS_ROLE_ARN }} |
| 65 | + aws-region: us-east-1 |
| 66 | + |
| 67 | + - name: Push documentation to S3 |
| 68 | + if: env.PUBLISH == 'true' |
| 69 | + run: | |
| 70 | + aws s3 sync docs/_build/html "s3://${{ secrets.LIBVCS_DOCS_BUCKET }}" \ |
| 71 | + --delete --follow-symlinks |
| 72 | +
|
| 73 | + - name: Invalidate CloudFront |
| 74 | + if: env.PUBLISH == 'true' |
| 75 | + run: | |
| 76 | + aws cloudfront create-invalidation \ |
| 77 | + --distribution-id "${{ secrets.LIBVCS_DOCS_DISTRIBUTION }}" \ |
| 78 | + --paths "/index.html" "/objects.inv" "/searchindex.js" |
66 | 79 |
|
67 | 80 | - name: Purge cache on Cloudflare |
68 | 81 | if: env.PUBLISH == 'true' |
|
0 commit comments