d2-admin/.github/workflows/main.yml

31 lines
851 B
YAML

name: Build and upload to qiniu CDN
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: install packages
run: npm i
- name: build
run: npm run build:github
- name: qiniu login
run: ./deploy/qshell account ${{ secrets.AK }} ${{ secrets.SK }} liyang
- name: qiniu upload
run: |
dist=$GITHUB-WORKSPACE/dist
bucket=fairyever-site
prefix=d2-admin/preview/
./deploy/qshell qupload2 --src-dir=$dist --bucket=$bucket --key-prefix=$prefix --overwrite=true --check-exists=true --check-hash=true --check-size=true --rescan-local=true
- name: refresn CDN
run: ./deploy/qshell cdnrefresh --dirs -i ./deploy/cdnrefresh.txt