Skip to content

Commit 3c9db0b

Browse files
authored
Update S3 deployment workflow for dev branch
1 parent b0bfa9b commit 3c9db0b

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

.github/workflows/all_code_to_s3.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ name: Deploy all code files for SPEAR site to S3
33
on:
44
push:
55
branches:
6-
- 'main'
6+
- 'erin-dev'
77
paths:
88
- '.github/workflows/all_code_to_s3.yml'
99

10-
1110
permissions:
1211
id-token: write
1312
contents: read
1413

1514
env:
16-
BUCKET_NAME: spear-front-end
15+
BUCKET_NAME: spear-erin-dev
1716

1817
jobs:
1918
deploy:
@@ -28,27 +27,27 @@ jobs:
2827
- name: Configure AWS credentials
2928
uses: aws-actions/configure-aws-credentials@v2
3029
with:
31-
role-to-assume: ${{ secrets.AWS_SPEAR_ARN }}
30+
role-to-assume: ${{ secrets.AWS_DEV_SPEAR_ARN }}
3231
aws-region: ${{ secrets.AWS_REGION }}
3332
role-session-name: GitHub-OIDC-frontend-spear
3433
role-duration-seconds: 21600
3534

3635

3736
# Step 3: Files to S3
3837
# This will add and overwrite all non data folder files to the S3 bucket but not delete files in S3 that have been deleted in the repo
39-
# - name: Sync files in S3
40-
# if: success()
41-
# run: |
42-
# aws s3 sync ./ s3://spear-front-end --exact-timestamps --exclude "data/*" --exclude ".github/*" --exclude "aggregate/*"
43-
# env:
44-
# AWS_REGION: ${{ secrets.AWS_REGION }}
45-
# AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
46-
47-
# - name: Invalidate CloudFront Cache
48-
# run: |
49-
# aws cloudfront create-invalidation \
50-
# --distribution-id ${{ secrets.SPEAR_CLOUDFRONT_DISTRIBUTION_ID}} \
51-
# --paths "/*"
52-
# env:
53-
# AWS_REGION: ${{ secrets.AWS_REGION }}
54-
# AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
38+
- name: Sync files in S3
39+
if: success()
40+
run: |
41+
aws s3 sync ./ s3://spear-front-end --exact-timestamps --exclude "data/*" --exclude ".github/*" --exclude "aggregate/*"
42+
env:
43+
AWS_REGION: ${{ secrets.AWS_REGION }}
44+
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
45+
46+
- name: Invalidate CloudFront Cache
47+
run: |
48+
aws cloudfront create-invalidation \
49+
--distribution-id ${{ secrets.DEV_SPEAR_CLOUDFRONT_DISTRIBUTION_ID}} \
50+
--paths "/*"
51+
env:
52+
AWS_REGION: ${{ secrets.AWS_REGION }}
53+
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}

0 commit comments

Comments
 (0)