Skip to content

Deploy React App to S3 #8

Deploy React App to S3

Deploy React App to S3 #8

Workflow file for this run

name: Deploy React App to S3
on:
workflow_dispatch: # manual trigger
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies
run: npm ci
- name: Build React App
env:
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
run: npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy to S3
run: |
aws s3 sync build/ s3://waa-project-react-frontend