-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.53 KB
/
cos.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
51
52
53
54
55
56
57
name: Continuous integration of static websites to COS
on:
push:
branches: [ "main" ]
jobs:
build_and_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "21" # 使用 Node.js 21 版本
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- name: Enable Corepack
run: corepack enable
- name: Prepare Yarn
run: corepack prepare [email protected] --activate
- name: Install dependencies
run: yarn install
- name: Build with Nuxt
run: yarn build
- name: Generate
run: yarn generate
- name: 安装腾讯云依赖
run: |
sudo pip install coscmd
sudo pip install tccli
- name: 配置腾讯云依赖
env:
SECRET_ID: ${{ secrets.TCLOUD_API_ID }}
SECRET_KEY: ${{ secrets.TCLOUD_API_KEY }}
BUCKET: schem-1318358151
REGION: ap-shanghai
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: 上传到腾讯云COS并刷新CDN
run: |
coscmd upload -rfs --delete ./.output/public/ /
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://schem.alsace.team/ --FlushType flush