Files
fzu-product/.github/workflows/cos.yaml
2023-07-14 21:11:35 +08:00

41 lines
1.0 KiB
YAML

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 -m 30 -p 10
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