From cfd280ab75c38be862d2e35b81f3e16c5fd860df Mon Sep 17 00:00:00 2001 From: YunYouJun Date: Tue, 8 Oct 2024 08:19:35 +0800 Subject: [PATCH] ci: add teo purge --- .github/workflows/teo.yml | 41 +++++++++++++++++++++++++++++++++++++++ README.md | 13 +++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/teo.yml diff --git a/.github/workflows/teo.yml b/.github/workflows/teo.yml new file mode 100644 index 000000000..a9293cda9 --- /dev/null +++ b/.github/workflows/teo.yml @@ -0,0 +1,41 @@ +name: TEO Purge + +on: + push: + branches: + - main + - valaxy + + pull_request: + branches: + - main + - valaxy + +jobs: + teo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: pnpm + + - name: Install + run: pnpm install + + - name: Install TCCLI + run: sudo pip install tccli + + - name: Configure TCCLI + run: | + tccli configure set secretId ${{ secrets.TENCENT_CLOUD_SECRET_ID }} + tccli configure set secretKey ${{ secrets.TENCENT_CLOUD_SECRET_KEY }} + tccli configure set region ap-shanghai + + - name: Wait Cloudflare Pages Deploy + run: echo 'Waiting for Cloudflare Pages Deploy' + + - name: Purge TEO + run: tccli teo CreatePurgeTask --ZoneId zone-32usfya3lb5o --Type purge_host --Targets '["www.yunyoujun.cn"]' diff --git a/README.md b/README.md index 394fee96e..7209cee44 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,19 @@ git clone https://github.com/YunYouJun/hexo-theme-yun themes/yun [![Tencent Cloud](https://imgcache.qq.com/open_proj/proj_qcloud_v2/gateway/portal/css/img/nav/logo-bg-color.svg)](https://cloud.tencent.com/) +```bash +# https://cloud.tencent.com/document/product/440/111345 +tccli auth login +``` + +#### EdgeOne 刷新缓存 + +```bash +# EdgeOne yunyoujun.cn +# https://cloud.tencent.com/document/product/1552/70759 +tccli teo CreatePurgeTask --ZoneId zone-32usfya3lb5o --Type purge_host --Targets '["www.yunyoujun.cn"]' +``` + #### 刷新目录 ```bash