-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (38 loc) · 1.21 KB
/
Copy pathprod.yaml
File metadata and controls
43 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
name: Build and React App to S3 Bucket
on:
push:
branches: [main]
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
env:
# React App/Build Settings
DIST: build
SKIP_PREFLIGHT_CHECK: true
REACT_APP_API_URL: ${{ secrets.REACT_APP_PROD_API_URL }}
# AWS Settings
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ${{ secrets.PROD_S3_BUCKET }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Install Dependencies
run: |
node --version
npm install --global yarn
yarn install
- name: Build Static Website
run: yarn build
- name: Copy files to the S3 Bucket with the AWS CLI
run: |
aws s3 sync --delete ${{ env.DIST }} s3://${{ env.S3_BUCKET }}