-
Notifications
You must be signed in to change notification settings - Fork 29
47 lines (42 loc) · 1.12 KB
/
deploy-cdn.yml
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
name: Deploy https://cdn.d2.pub
on:
push:
branches:
- master
env:
SITE: https://cdn.d2.pub/
QINIU_BUCKET: d2-cdn
DIST_FOLDER: /site/.vuepress/dist
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Download qshell
run: |
wget http://devtools.qiniu.com/qshell-linux-x86-v2.4.0.zip
unzip qshell-linux-x86-v2.4.0.zip
mv qshell-linux-x86-v2.4.0 qshell
- name: Install packages
run: npm i
- name: Build
run: npm run build
- name: CDN login
run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION
- name: CDN upload
run: |
echo $SITE > cdnrefresh.txt
./qshell qupload2 \
--src-dir=$GITHUB_WORKSPACE$DIST_FOLDER \
--bucket=$QINIU_BUCKET \
--overwrite=true \
--check-exists=true \
--check-hash=true \
--check-size=true \
--rescan-local=true \
--thread-count=32
- name: CDN refresh
run: ./qshell cdnrefresh --dirs -i ./cdnrefresh.txt