generated from rudderlabs/rudder-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update deploy-to-s3.yml workflow
- Loading branch information
Showing
1 changed file
with
32 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 "/*" |