This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
enhancement: 1. update integration dashboard ux 2. add dotenv example… #18
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 the TS SDK upload to S3, and invalidate cloudFront cache | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- packages/js/** | |
jobs: | |
build-deploy-js-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Install Dependencies | |
run: yarn install | |
- name: Build SDK | |
run: yarn workspace @revertdotdev/js deploy | |
env: | |
CORE_API_BASE_URL: ${{ secrets.CORE_API_BASE_URL }} | |
REDIRECT_URL_BASE: ${{ secrets.REDIRECT_URL_BASE }} | |
- name: List Files in Workspace | |
run: ls -R packages/js/build | |
- name: Upload bundle to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --follow-symlinks | |
env: | |
AWS_S3_BUCKET: cdn.revert.dev | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
SOURCE_DIR: 'packages/js/build' | |
- name: Invalidate CloudFront Cache | |
run: | | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set default.region ${{ secrets.AWS_REGION }} | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*" |