Skip to content

Commit 84d9af6

Browse files
committed
Use iam role and new (stage) s3 bucket
1 parent 363e2f3 commit 84d9af6

File tree

5 files changed

+37
-13
lines changed

5 files changed

+37
-13
lines changed

.github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
## How do we test the changes introduced in this PR?
66

7-
## Extra Notes
7+
## Extra Notes

.github/workflows/ci-cd.yml

+33-9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
branches:
99
- '*'
1010

11+
permissions:
12+
contents: read
13+
id-token: write
14+
1115
jobs:
1216
build:
1317
name: Build
@@ -34,7 +38,24 @@ jobs:
3438
- name: npm Build
3539
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build
3640

37-
- name: Deploy S3 Development
41+
- name: Configure AWS credentials (development)
42+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
43+
uses: aws-actions/configure-aws-credentials@v1
44+
with:
45+
role-to-assume: arn:aws:iam::079419646996:role/public-assets
46+
aws-region: us-east-1
47+
48+
- name: Upload to S3 (development)
49+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
50+
run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS
51+
env:
52+
BUCKET: split-public-stage
53+
SOURCE_DIR: ./umd
54+
DEST_DIR: sdk
55+
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public
56+
57+
# TODO: Remove this upload step to the old (dev) Bucket
58+
- name: Upload to S3 (development) (legacy)
3859
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
3960
uses: jakejarvis/[email protected]
4061
with:
@@ -47,15 +68,18 @@ jobs:
4768
SOURCE_DIR: './umd'
4869
DEST_DIR: sdk
4970

50-
- name: Deploy S3 Master
71+
- name: Configure AWS credentials (master)
5172
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
52-
uses: jakejarvis/[email protected]
73+
uses: aws-actions/configure-aws-credentials@v1
5374
with:
54-
args: --acl public-read --follow-symlinks --cache-control max-age=31536000,public
75+
role-to-assume: arn:aws:iam::825951051969:role/public-assets
76+
aws-region: us-east-1
77+
78+
- name: Upload to S3 (master)
79+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
80+
run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS
5581
env:
56-
AWS_S3_BUCKET: 'split-public'
57-
AWS_ACCESS_KEY_ID: ${{ secrets.PUBLIC_ASSETS_PROD_USER }}
58-
AWS_SECRET_ACCESS_KEY: ${{ secrets.PUBLIC_ASSETS_PROD_KEY }}
59-
AWS_REGION: 'us-east-1'
60-
SOURCE_DIR: './umd'
82+
BUCKET: split-public
83+
SOURCE_DIR: ./umd
6184
DEST_DIR: sdk
85+
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public

CONTRIBUTORS-GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ If you want to debug your changes consuming it from a test application, you can
4141

4242
# Contact
4343

44-
If you have any other questions or need to contact us directly in a private manner send us a note at [email protected]
44+
If you have any other questions or need to contact us directly in a private manner send us a note at [email protected]

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ module.exports = {
1313
"src/**/*.{js,jsx,ts,tsx}",
1414
"!src/__tests__/**",
1515
]
16-
};
16+
};

tslint.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
"no-unused-variable": true
2323
},
2424
"rulesDirectory": []
25-
}
25+
}

0 commit comments

Comments
 (0)