From 497a63486d7116d6c0d6c858ede7fd17267067e7 Mon Sep 17 00:00:00 2001 From: MengYX Date: Sun, 10 Nov 2019 18:41:35 +0800 Subject: [PATCH] CI: Auto Deploy and Use Cache --- .drone.yml | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 4411f6d..6245be0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,10 +7,20 @@ clone: depth: 1 steps: + - name: restore-cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + restore: true + mount: + - ./node_modules + - name: installDependencies image: node:lts commands: - - npm config set registry http://registry.npm.taobao.org + - npm config set registry http://registry.npm.taobao.org --global - npm install - name: build @@ -31,3 +41,30 @@ steps: - sha256 when: event: [tag] + + - name: deploy + image: plugins/s3 + settings: + bucket: unlock-music + access_key: + from_secret: aws_access_key_id + secret_key: + from_secret: aws_secret_access_key + source: dist/**/* + target: / + path_style: true + endpoint: https://fs.sz2.ixarea.com + + - name: rebuild-cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + rebuild: true + mount: + - ./node_modules +volumes: + - name: cache + host: + path: /tmp/cache \ No newline at end of file