Skip to content

Commit

Permalink
chore: update deploy-to-s3.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
koladilip committed Jun 14, 2024
1 parent b3b94e7 commit bc963dd
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,35 @@ jobs:
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 "/*"
- 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 "/*"

0 comments on commit bc963dd

Please sign in to comment.