This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
enhancement: add github action to build js sdk (#184) #1
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 | |
jobs: | |
build-upload-invalidate: | |
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 build | |
env: | |
CORE_API_BASE_URL: ${{ secrets.CORE_API_BASE_URL }} | |
REDIRECT_URL_BASE: ${{ secrets.REDIRECT_URL_BASE }} | |
# - name: Upload to S3 | |
# uses: jakejarvis/s3-sync-action@master | |
# with: | |
# args: --acl public-read --follow-symlinks --delete | |
# env: | |
# AWS_S3_BUCKET: your-bucket-name | |
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# SOURCE_DIR: path/to/your/dist/directory | |
# - 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 your-aws-region | |
# aws cloudfront create-invalidation --distribution-id your-cloudfront-distribution-id --paths "/*" |