feat: ci
This commit is contained in:
41
.github/workflows/cos.yaml
vendored
Normal file
41
.github/workflows/cos.yaml
vendored
Normal 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
|
||||||
Reference in New Issue
Block a user