File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy Frontend
2
+
3
+ on :
4
+ push :
5
+ branches : [ 'main' ]
6
+ paths :
7
+ - ' frontend/**' # Only trigger if changes are made in the frontend directory
8
+ pull_request :
9
+
10
+ workflow_dispatch :
11
+
12
+ permissions :
13
+ id-token : write # This is required for requesting the JWT
14
+ contents : read # This is required for actions/checkout
15
+
16
+ env :
17
+ AWS_REGION : ap-southeast-1
18
+ S3_BUCKET_NAME : app.peerprep.org
19
+
20
+ jobs :
21
+ deploy :
22
+ name : Deploy Frontend
23
+ runs-on : ubuntu-latest
24
+ environment : production
25
+
26
+ steps :
27
+ - uses : actions/checkout@v4
28
+
29
+ - name : Configure AWS credentials
30
+ id : aws-configure
31
+ uses :
aws-actions/[email protected]
32
+ with :
33
+ role-to-assume : arn:aws:iam::491085383176:role/github_s3_copy
34
+ role-session-name : GitHub_to_AWS_via_FederatedOIDC
35
+ aws-region : ${{ env.AWS_REGION }}
36
+
37
+ - name : Build frontend distribution
38
+ working-directory : frontend
39
+ run : npm ci && npm run build
40
+
41
+ - name : Sync distribution to S3
42
+ run : |
43
+ aws s3 sync ./frontend/dist/frontend/browser/ s3://$S3_BUCKET_NAME --delete
You can’t perform that action at this time.
0 commit comments