-
Notifications
You must be signed in to change notification settings - Fork 82
33 lines (31 loc) · 1.02 KB
/
deploy.yaml
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
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to AWS
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: make install
run: make install
- name: make build
run: make build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Sync with S3 and invalidate cache
run: make deploy
#run: |
# FILES=`aws s3 sync --size-only --dryrun public/ s3://${{ secrets.S3_BUCKET }} | awk '{print $3;}' | cut -c 7- | tr '\n' ' '`
# echo $FILES
# aws s3 sync --size-only --delete public/ s3://${{ secrets.S3_BUCKET }}
# if [ -n "${FILES}" ]; then aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID }} --paths $FILES; fi