-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.8 KB
/
deploy.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
56
57
58
59
60
name: CI/CD Pipeline
on:
push:
branches: ["master", "feat/布局"]
pull_request:
branches: ["master", "feat/布局"]
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '20'
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Configure COSCMD
if: github.event_name == 'push'
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
COS_BUCKET_NAME: ${{ secrets.COS_BUCKET_NAME }}
COS_BUCKET_REGION: ${{ secrets.COS_BUCKET_REGION }}
run: |
pip install coscmd
coscmd config -a $COS_SECRET_ID -s $COS_SECRET_KEY -b $COS_BUCKET_NAME -r $COS_BUCKET_REGION
- name: Upload to COS Bucket
if: github.event_name == 'push'
env:
COS_UPLOAD_FROM_PATH: ${{ secrets.COS_UPLOAD_FROM_PATH }}
run: coscmd upload -r $COS_UPLOAD_FROM_PATH /
- name: Invalidate CDN cache
if: github.event_name == 'push'
env:
TENCENTCLOUD_SECRET_ID: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
TENCENTCLOUD_REGION: ap-beijing
run: |
pip install tccli
tccli cdn PurgePathCache --cli-unfold-argument --Paths 'https://cloudmind.top/' --FlushType flush
- name: Send Change Log
if: github.event_name == 'push'
uses: xh-polaris/send-changelog@v1
with:
webhook_url: ${{ secrets.Front_WEBHOOK_URL }}
title: CloudMind前端更新日志