forked from pingcap/docs-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 869 Bytes
/
flush.yaml
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
name: Flush All PDF
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # auto flush pdf on sunday
jobs:
flush-pdf:
name: Flush PDF
runs-on: ubuntu-latest
steps:
- name: install qiniu qshell
uses: foxundermoon/setup-qshell@v5
with:
version: '2.6.2'
- name: Download PDF list
run: |
curl https://raw.githubusercontent.com/pingcap/docs-cn/master/resources/cdnfresh.txt --output cdnfresh.txt
cat cdnfresh.txt
- name: refresh url
run: |
qshell account ${{ secrets.QINIU_ACCESS_KEY }} ${{ secrets.QINIU_SECRET_KEY }} tidb
result=$(qshell cdnrefresh -i cdnfresh.txt)
if echo $result | grep -w '200'; then
echo 'CDN refresh success'
else
echo "CDN refresh failed: $result"
exit 1
fi