Skip to content

Fix S3 upload

Fix S3 upload #6

name: Frontend Build and upload to S3
on:
push:
branches: [ master ]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build_push.yml'
pull_request:
branches: [ master ]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build_push.yml'
permissions:
id-token: write
contents: read
jobs:
build_and_upload:
runs-on: ubuntu-latest
environment: Production
env:
CI: false
strategy:
matrix:
node-version: [ 16 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: cd frontend/ && npm install --legacy-peer-deps
- name: Build frontend
run: cd frontend/ && npm run build
- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}
role-session-name: fAIrGithub
- name: Upload to S3
run: ls -lh frontend/build && aws s3 cp frontend/build/ s3://${{ vars.FRONTEND_BUCKET }}/