This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 74
55 lines (47 loc) · 1.88 KB
/
deploy-js-sdk.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build the TS SDK upload to S3, and invalidate cloudFront cache
on:
push:
branches:
- main
paths:
- packages/js/**
workflow_dispatch:
inputs:
task_name:
description: 'Enter the name of the task'
required: false
default: 'deploy-js-sdk'
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: 17
- 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: cdn2.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 "/*"