update ci
Former-commit-id: 7698103c8ce5182ec044b3cf24bfdb09d6c8b966
This commit is contained in:
@@ -1,50 +1,30 @@
|
|||||||
name: Build and upload to qiniu CDN
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
|
||||||
SITE: https://fairyever.com/
|
|
||||||
QINIU_BUCKET: fairyever-site
|
|
||||||
DIST_FOLDER: /dist
|
|
||||||
PATH_SUFFIX: /preview
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
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
|
- name: Build
|
||||||
run: npm run build:github
|
|
||||||
- name: CDN login
|
|
||||||
run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION
|
|
||||||
- name: CDN upload
|
|
||||||
run: |
|
run: |
|
||||||
REPO=${GITHUB_REPOSITORY//*\//}
|
npm install
|
||||||
REFRESH_URL=$SITE$REPO$PATH_SUFFIX/
|
npm run build:github
|
||||||
echo $REFRESH_URL > cdnrefresh.txt
|
- name: Deploy
|
||||||
./qshell qupload2\
|
uses: SamKirkland/FTP-Deploy-Action@2.0.0
|
||||||
--src-dir=$GITHUB_WORKSPACE$DIST_FOLDER\
|
env:
|
||||||
--bucket=$QINIU_BUCKET\
|
FTP_SERVER: ${{ secrets.FTP_SERVER }}
|
||||||
--key-prefix=$REPO$PATH_SUFFIX/\
|
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
|
||||||
--overwrite=true\
|
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
||||||
--check-exists=true\
|
METHOD: sftp
|
||||||
--check-hash=true\
|
PORT: ${{ secrets.FTP_PORT }}
|
||||||
--check-size=true\
|
LOCAL_DIR: dist
|
||||||
--rescan-local=true
|
REMOTE_DIR: /www/d2-admin-start-kit/preview
|
||||||
- name: CDN refresh
|
ARGS: --delete --verbose --parallel=100
|
||||||
run: ./qshell cdnrefresh --dirs -i ./cdnrefresh.txt
|
|
||||||
Reference in New Issue
Block a user