forked from ljxi/NetworkPanel
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.14 KB
/
build_and_deploy.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
name: auto-build and upload to tencent COS
on:
push:
branches:
- main
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@master
- name: Install & Build
run: |
npm install
npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
- name: Sync-to-tencent-cos
run: |
pip install coscmd
echo "Sync to tencent cos..."
cd dist
coscmd config -a ${{ secrets.SECRET_ID }} -s ${{ secrets.SECRET_KEY }} -b ${{ secrets.BUCKET }} -e cos.accelerate.myqcloud.com -m 30
coscmd upload -rs ./ / --ignore "./.git/*","./.github/*","./README.md"
coscmd abort
echo "Delete old files..."
curl https://raw.githubusercontent.com/ljxi/Sync-to-tencent-cos/main/Delete-old-files.py -o ./Delete-old-files.py
python Delete-old-files.py
echo "Sync to tencent cos done!"