From d9c4f96f80b894c92c20b2c74c2215c243d3b9aa Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Wed, 27 Nov 2019 10:04:13 +0800 Subject: [PATCH] ci Former-commit-id: 144e190a0203b694ab0342e92c73c6e0e8e0347b --- .github/workflows/qiniu.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/star.yml | 17 +++++++++++++++++ .travis.yml | 22 ---------------------- deploy/upload.conf | 11 ----------- 4 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/qiniu.yml create mode 100644 .github/workflows/star.yml delete mode 100644 .travis.yml delete mode 100644 deploy/upload.conf diff --git a/.github/workflows/qiniu.yml b/.github/workflows/qiniu.yml new file mode 100644 index 0000000..dfee4fc --- /dev/null +++ b/.github/workflows/qiniu.yml @@ -0,0 +1,31 @@ +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-start-kit/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 \ No newline at end of file diff --git a/.github/workflows/star.yml b/.github/workflows/star.yml new file mode 100644 index 0000000..f218da3 --- /dev/null +++ b/.github/workflows/star.yml @@ -0,0 +1,17 @@ +name: Send message on star + +on: + watch: + types: [started] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: send bark message + run: | + repo=${GITHUB_REPOSITORY//\//:} + actor=$GITHUB_ACTOR + curl https://api.day.app/EweNWLE36rvVR8EFfWGq7k/$actor%20star%20了你的仓库/$repo \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d18d0a3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js -node_js: stable - -cache: - directories: - - "node_modules" - -branches: - only: - - master - -script: - - npm run build:travis - -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH=$HOME/.yarn/bin:$PATH - -after_success: - - ./deploy/qshell account $AK $SK liyang - - ./deploy/qshell qupload ./deploy/upload.conf - - ./deploy/qshell cdnrefresh --dirs -i ./deploy/cdnrefresh.txt \ No newline at end of file diff --git a/deploy/upload.conf b/deploy/upload.conf deleted file mode 100644 index 2f94fe6..0000000 --- a/deploy/upload.conf +++ /dev/null @@ -1,11 +0,0 @@ -{ - "src_dir" : "/home/travis/build/d2-projects/d2-admin-start-kit/dist", - "bucket" : "fairyever-site", - "key_prefix" : "d2-admin-start-kit/preview/", - "ignore_dir" : false, - "overwrite" : true, - "check_exists" : true, - "check_hash" : true, - "check_size" : true, - "rescan_local" : true -} \ No newline at end of file