Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add deploy script #10

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Staging Frontend

on:
push:
branches:
- deploy

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
Loading