-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.32 KB
/
prod-deploy-cdn.yml
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
name: Prod Release to CDN
on:
workflow_dispatch:
jobs:
build:
if: ${{github.repository == 'gtech-world/carbon3-home' && github.ref == 'refs/heads/prod'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup Node v16
uses: actions/setup-node@v2
with:
node-version: v16.16.0
cache: 'pnpm'
- name: Run install
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm export
- name: Install coscmd
run: |
sudo pip install coscmd
sudo pip install tccli
- name: Config coscmd
env:
SECRET_ID: ${{ secrets.CDN_SECRET_ID }}
SECRET_KEY: ${{ secrets.CDN_SECRET_KEY }}
BUCKET: ${{ secrets.CDN_BUCKET }}
REGION: ${{ secrets.CDN_REGION }}
run: |
coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION
tccli configure set secretId $SECRET_ID
tccli configure set secretKey $SECRET_KEY
tccli configure set region $REGION
- name: Uplaod to CDN
run: |
coscmd upload -rs --delete -f ./out/ /
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://aicp.gtech-cn.co/ --FlushType flush