chore: format files #20
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 Deploy React App | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write # allows the JWT to be requested from GitHub's OIDC provider | |
contents: read # This is required for actions/checkout | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Setup Node.js with .nvmrc | |
uses: actions/[email protected] | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install Yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: yarn install | |
- name: Build React App with Vite | |
run: yarn build | |
- name: Assume IAM Role and Set AWS Credentials | |
id: assume-role | |
uses: aws-actions/[email protected] | |
with: | |
aws-region: us-east-1 | |
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN }} | |
role-duration-seconds: 900 # Adjust as needed | |
- name: Synchronize with S3 and Invalidate CloudFront | |
run: | | |
cd dist | |
aws s3 sync . s3://transformers-workflow-engine --delete | |
aws cloudfront create-invalidation --distribution-id E2PO7XUKI9DBAP --paths "/*" |