This commit is contained in:
camera-2018
2023-06-19 12:24:38 +08:00
parent b080b54c84
commit 2f0ea17b89

41
.github/workflows/cos.yaml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: update to cos
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: install dependencies
run: |
sudo pip install coscmd
sudo pip install tccli
npm i
- name: build
run: |
npm run docs:build
- name: confirgure coscmd and tccli
env:
SECRET_ID: ${{ secrets.TCLOUD_API_ID }}
SECRET_KEY: ${{ secrets.TCLOUD_API_KEY }}
BUCKET: hdu-cs-wiki-1307923872
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: upload and refresh cdn
run: |
coscmd upload -rfs --delete ./.vitepress/dist/ /
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://wiki.xyxsw.site/ --FlushType flush