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