-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
309a5b8
commit 0e00581
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Deploy Staging Frontend | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build code | ||
env: | ||
CI: "" | ||
REACT_APP_STAC_API: ${{ secrets.STAC_API }} | ||
run: yarn build | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ secrets.DEPLOY_ROLE_ARN }} | ||
aws-region: us-west-2 | ||
|
||
- name: Sync with S3 bucket | ||
env: | ||
BUCKET: ${{ secrets.S3_BUCKET }} | ||
run: | | ||
aws s3 sync \ | ||
./build "s3://${BUCKET}" \ | ||
--acl public-read \ | ||
--follow-symlinks \ | ||
--delete |