-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (46 loc) · 1.98 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Upload Website
on:
push:
branches:
- main
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: upload to unpublished bucket
uses: jakejarvis/s3-sync-action@master
with:
args: --metadata pdfsource=custom-pdfs --size-only
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_UNPUBLISHED_PRODUCTION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_PDF_UPLOADER_PRODUCTION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_PDF_UPLOADER_PRODUCTION }}
AWS_REGION: 'eu-west-2' # optional: defaults to us-east-1
SOURCE_DIR: 'files' # optional: defaults to entire repository
- name: upload to published bucket
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --metadata pdfsource=custom-pdfs --size-only
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_PUBLISHED_PRODUCTION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_PDF_UPLOADER_PRODUCTION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_PDF_UPLOADER_PRODUCTION }}
AWS_REGION: 'eu-west-2' # optional: defaults to us-east-1
SOURCE_DIR: 'files' # optional: defaults to entire repository
- name: configure AWS credentials for cloudfront invalidation
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_PDF_UPLOADER_PRODUCTION}}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PDF_UPLOADER_PRODUCTION }}
aws-region: 'eu-west-2'
- 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'