-
Notifications
You must be signed in to change notification settings - Fork 1.2k
62 lines (56 loc) · 1.93 KB
/
flush-version.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Flush PDF by Version
on:
# manual flush pdf for specified version
workflow_dispatch:
inputs:
type:
required: true
type: choice
options: ['tidb', 'tidb cloud', 'tidb operator']
default: 'tidb'
description: "the type"
version:
required: false
type: string
description: "the version, e.g. v6.5 or dev"
# lang:
# required: false
# type: choice
# options: ['en', 'zh']
# description: "The language"
jobs:
flush-pdf:
name: Flush PDF by Version
runs-on: ubuntu-latest
steps:
- name: install qiniu qshell
uses: foxundermoon/setup-qshell@v5
with:
version: '2.6.2'
- name: print pdf to a file (tidb)
if: ${{ inputs.type == 'tidb' }}
run: |
echo "https://download.pingcap.org/tidb-${{inputs.version}}-en-manual.pdf" >> pdf.txt
echo "https://download.pingcap.org/tidb-${{inputs.version}}-zh-manual.pdf" >> pdf.txt
cat pdf.txt
- name: print pdf to a file (tidb cloud)
if: ${{ inputs.type == 'tidb cloud' }}
run: |
echo "https://download.pingcap.org/tidbcloud-en-manual.pdf" > pdf.txt
cat pdf.txt
- name: print pdf to a file (tidb operator)
if: ${{ inputs.type == 'tidb operator' }}
run: |
echo "https://download.pingcap.org/tidb-in-kubernetes-${{inputs.version}}-en-manual.pdf" >> pdf.txt
echo "https://download.pingcap.org/tidb-in-kubernetes-${{inputs.version}}-zh-manual.pdf" >> pdf.txt
cat pdf.txt
- name: refresh url
run: |
qshell account ${{ secrets.QINIU_ACCESS_KEY }} ${{ secrets.QINIU_SECRET_KEY }} tidb
result=$(qshell cdnrefresh -i pdf.txt)
if echo $result | grep -w '200'; then
echo 'CDN refresh success'
else
echo "CDN refresh failed: $result"
exit 1
fi