Add files via upload #1010
This file contains 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: Upload Website | |
permissions: | |
id-token: write | |
contents: read | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_OIDC_PRODUCTION_ROLE_ARN }} | |
aws-region: eu-west-2 | |
- name: upload to unpublished bucket | |
run: > | |
aws s3 sync files s3://${{ secrets.AWS_S3_BUCKET_UNPUBLISHED_PRODUCTION }}/ | |
--no-progress | |
--metadata pdfsource=custom-pdfs | |
--size-only | |
- name: upload to published bucket | |
run: > | |
aws s3 sync files s3://${{ secrets.AWS_S3_BUCKET_PUBLISHED_PRODUCTION }}/ | |
--no-progress | |
--metadata pdfsource=custom-pdfs | |
--size-only | |
- uses: badsyntax/github-action-aws-cloudfront@master | |
name: Invalidate assets.caselaw.nationalarchives.gov.uk | |
id: invalidate-cloudfront-cache | |
with: | |
distribution-id: ${{ secrets.AWS_ASSETS_DISTRIBUTION_ID }} | |
aws-region: "eu-west-2" | |
origin-prefix: "" | |
include-origin-prefix: false | |
invalidate-paths: "/*" | |
default-root-object: "index.html" |