-
Notifications
You must be signed in to change notification settings - Fork 118
49 lines (39 loc) · 1.75 KB
/
deploy.yaml
File metadata and controls
49 lines (39 loc) · 1.75 KB
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
name: Deploy Widget to S3
on:
push:
branches:
- main
jobs:
build:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
role-to-assume: arn:aws:iam::403372804574:role/github-actions
role-session-name: github-actions-role-session
aws-region: us-east-2
- name: Amazon ECR login
id: login-ecr
uses: aws-actions/amazon-ecr-login@183a1442edf41672e66566b7fc560e297a290896 # v2.1.1
- name: Install dependencies
uses: ./.github/actions/pnpm-install
- name: Build application
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: pnpm build
- name: Deploy app build to S3 bucket
run: |
# This single command deploys all files with a "no-cache" rule.
aws s3 sync ./packages/widget-playground-vite/dist/ s3://playground.li.fi --cache-control 'no-cache,no-store,must-revalidate' --delete
# Repeats the same process for the second application.
aws s3 sync ./packages/widget-embedded/dist/ s3://widget.li.fi --cache-control 'no-cache,no-store,must-revalidate' --delete
- name: Purge Cloudflare Cache by Hostname
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/purge_cache" \
-H "Authorization: Bearer ${{ secrets.CF_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{"hosts":["playground.li.fi", "widget.li.fi"]}'