Skip to content

Commit 8f61030

Browse files
committed
update ci
Former-commit-id: 7698103c8ce5182ec044b3cf24bfdb09d6c8b966
1 parent 53d59a3 commit 8f61030

1 file changed

Lines changed: 14 additions & 34 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,30 @@
1-
name: Build and upload to qiniu CDN
1+
name: Deploy
22

33
on:
44
push:
55
branches:
66
- master
77

8-
env:
9-
SITE: https://fairyever.com/
10-
QINIU_BUCKET: fairyever-site
11-
DIST_FOLDER: /dist
12-
PATH_SUFFIX: /preview
13-
148
jobs:
159
build:
16-
1710
runs-on: ubuntu-latest
18-
1911
steps:
2012
- uses: actions/checkout@v1
2113
- uses: actions/setup-node@v1
2214
with:
2315
node-version: '10.x'
24-
- name: Download qshell
25-
run: |
26-
wget http://devtools.qiniu.com/qshell-linux-x86-v2.4.0.zip
27-
unzip qshell-linux-x86-v2.4.0.zip
28-
mv qshell-linux-x86-v2.4.0 qshell
29-
- name: Install packages
30-
run: npm i
3116
- name: Build
32-
run: npm run build:github
33-
- name: CDN login
34-
run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION
35-
- name: CDN upload
3617
run: |
37-
REPO=${GITHUB_REPOSITORY//*\//}
38-
REFRESH_URL=$SITE$REPO$PATH_SUFFIX/
39-
echo $REFRESH_URL > cdnrefresh.txt
40-
./qshell qupload2\
41-
--src-dir=$GITHUB_WORKSPACE$DIST_FOLDER\
42-
--bucket=$QINIU_BUCKET\
43-
--key-prefix=$REPO$PATH_SUFFIX/\
44-
--overwrite=true\
45-
--check-exists=true\
46-
--check-hash=true\
47-
--check-size=true\
48-
--rescan-local=true
49-
- name: CDN refresh
50-
run: ./qshell cdnrefresh --dirs -i ./cdnrefresh.txt
18+
npm install
19+
npm run build:github
20+
- name: Deploy
21+
uses: SamKirkland/FTP-Deploy-Action@2.0.0
22+
env:
23+
FTP_SERVER: ${{ secrets.FTP_SERVER }}
24+
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
25+
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
26+
METHOD: sftp
27+
PORT: ${{ secrets.FTP_PORT }}
28+
LOCAL_DIR: dist
29+
REMOTE_DIR: /www/d2-admin-start-kit/preview
30+
ARGS: --delete --verbose --parallel=100

0 commit comments

Comments
 (0)