fix: page refresh when navigating home #23
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
name: Build and Publish to AWS S3 | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-east-2 | |
role-to-assume: arn:aws:iam::124355672874:role/GitHub_EconoSim_econosim.org | |
- name: Set up Node.js with caching | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: package-lock.json | |
- name: Install npm dependencies | |
run: | | |
npm install | |
- name: Build the React app | |
run: | | |
npm run build | |
- name: Sync build output to AWS S3 | |
run: | | |
aws s3 sync \ | |
build \ | |
s3://econosim-website/react \ | |
--cache-control "max-age=60, s-maxage=60" \ | |
--delete \ | |
--no-progress |