Skip to content

Commit 0e00581

Browse files
committed
ci: Add deploy script
1 parent 309a5b8 commit 0e00581

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Staging Frontend
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 18
21+
22+
- name: Check out repository code
23+
uses: actions/checkout@v2
24+
25+
- name: Install dependencies
26+
run: yarn install
27+
28+
- name: Build code
29+
env:
30+
CI: ""
31+
REACT_APP_STAC_API: ${{ secrets.STAC_API }}
32+
run: yarn build
33+
34+
- name: Configure AWS credentials
35+
uses: aws-actions/configure-aws-credentials@v1
36+
with:
37+
role-to-assume: ${{ secrets.DEPLOY_ROLE_ARN }}
38+
aws-region: us-west-2
39+
40+
- name: Sync with S3 bucket
41+
env:
42+
BUCKET: ${{ secrets.S3_BUCKET }}
43+
run: |
44+
aws s3 sync \
45+
./build "s3://${BUCKET}" \
46+
--acl public-read \
47+
--follow-symlinks \
48+
--delete

0 commit comments

Comments
 (0)