Former-commit-id: f45d1ee3cfa8f5a74fe4e24686cf175c03d62a51 Former-commit-id: dacd8a284e98950d06c9084c718374d33fab2eb6 Former-commit-id: f6d555776ccd38202f2fb3fd8e1ef68e33ce950c Former-commit-id: bcfa138567971ea345ad542a6722529cec5ad6c2 [formerly 57d21cc3fc8810051a1eb4c9780a386c884fc026] Former-commit-id: e096837f558763d0bca312eb48d18892d9801b0d Former-commit-id: bd545425e25d25f4ceecdf644c0e83d826c65b84 Former-commit-id: 34511552e2c9f44497d288b90aeba86d989c2118 Former-commit-id: f126154ca6ee734258a33e9f04530c656f265d01 Former-commit-id: 2bc439ae36f5fe20b73cb4ead89a2e6b2cfbbd68
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Build and upload to qiniu CDN
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
SITE: https://fairyever.com/
|
|
QINIU_BUCKET: fairyever-site
|
|
DIST_FOLDER: /dist
|
|
PATH_SUFFIX: /preview
|
|
|
|
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:github
|
|
- name: CDN login
|
|
run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION
|
|
- name: CDN upload
|
|
run: |
|
|
REPO=${GITHUB_REPOSITORY//*\//}
|
|
REFRESH_URL=$SITE$REPO$PATH_SUFFIX/
|
|
echo $REFRESH_URL > cdnrefresh.txt
|
|
./qshell qupload2\
|
|
--src-dir=$GITHUB_WORKSPACE$DIST_FOLDER\
|
|
--bucket=$QINIU_BUCKET\
|
|
--key-prefix=$REPO$PATH_SUFFIX/\
|
|
--overwrite=true\
|
|
--check-exists=true\
|
|
--check-hash=true\
|
|
--check-size=true\
|
|
--rescan-local=true
|
|
- name: CDN refresh
|
|
run: ./qshell cdnrefresh --dirs -i ./cdnrefresh.txt |