8
8
branches :
9
9
- ' *'
10
10
11
+ permissions :
12
+ contents : read
13
+ id-token : write
14
+
11
15
jobs :
12
16
build :
13
17
name : Build
34
38
- name : npm Build
35
39
run : BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build
36
40
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)
38
59
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
39
60
uses :
jakejarvis/[email protected]
40
61
with :
@@ -47,15 +68,18 @@ jobs:
47
68
SOURCE_DIR : ' ./umd'
48
69
DEST_DIR : sdk
49
70
50
- - name : Deploy S3 Master
71
+ - name : Configure AWS credentials (master)
51
72
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
52
- uses :
jakejarvis/[email protected]
73
+ uses : aws-actions/configure-aws-credentials@v1
53
74
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
55
81
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
61
84
DEST_DIR : sdk
85
+ ARGS : --acl public-read --follow-symlinks --cache-control max-age=31536000,public
0 commit comments