Skip to content

Commit e36c5b9

Browse files
authored
Add workflow for syncing THUAI9 to Tencent COS
This workflow automates the synchronization of the THUAI9 project to Tencent COS upon pushes to the dev or main branches.
1 parent 993717d commit e36c5b9

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/sync-cos.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Sync THUAI9 to Tencent COS
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: sync-thuai9-cos
12+
cancel-in-progress: false
13+
14+
jobs:
15+
sync-cos:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Export tracked files
23+
run: |
24+
mkdir -p upload
25+
git archive --format=tar HEAD | tar -xf - -C upload
26+
27+
- name: Install COSCLI
28+
run: |
29+
curl -L -o coscli https://cosbrowser.cloud.tencent.com/software/coscli/coscli-linux-amd64
30+
chmod +x coscli
31+
./coscli --version
32+
33+
- name: Configure COSCLI
34+
env:
35+
TENCENT_COS_SECRET_ID: ${{ secrets.TENCENT_COS_SECRET_ID }}
36+
TENCENT_COS_SECRET_KEY: ${{ secrets.TENCENT_COS_SECRET_KEY }}
37+
run: |
38+
cat > .cos.yaml <<EOF
39+
cos:
40+
base:
41+
secretid: "${TENCENT_COS_SECRET_ID}"
42+
secretkey: "${TENCENT_COS_SECRET_KEY}"
43+
sessiontoken: ""
44+
protocol: https
45+
buckets:
46+
- name: thuai9-1255334966
47+
alias: thuai9
48+
region: ap-beijing
49+
endpoint: cos.ap-beijing.myqcloud.com
50+
ofs: false
51+
EOF
52+
53+
- name: Sync to Tencent COS
54+
run: |
55+
./coscli sync upload cos://thuai9/ -r -c .cos.yaml

0 commit comments

Comments
 (0)