Skip to content

chore: update deploy-to-s3.yml workflow #21

chore: update deploy-to-s3.yml workflow

chore: update deploy-to-s3.yml workflow #21

Workflow file for this run

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: |
aws s3 rm s3://transformers-workflow-engine/assets --recursive
cd dist
aws s3 sync . s3://transformers-workflow-engine/
aws cloudfront create-invalidation --distribution-id E2PO7XUKI9DBAP --paths "/*"