From be205df62e943cc2c1413ee0668d8c2da1730c3b Mon Sep 17 00:00:00 2001 From: zhiqiang feng Date: Mon, 26 Sep 2022 15:08:42 +0800 Subject: [PATCH] add cache --- .drone.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 08aabc4..1bb9f21 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,6 +7,28 @@ platform: os: linux arch: amd64 +- name: restore-cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + restore: true + mount: + - ./node_modules + +- name: rebuild-cache + image: drillster/drone-volume-cache + volumes: + - name: cache + path: /cache + settings: + rebuild: true + mount: + - ./node_modules + + + clone: image: reg.int.it2000.com.cn/devops/git tags: true @@ -15,21 +37,22 @@ clone: steps: - name: build image: reg.int.it2000.com.cn/library/node:14.20-bullseye - #volumes: - # - name: app - # path: /drone/src commands: - node -v - npm -v - yarn --version + - yarn install volumes: - - name: app + - name: cache host: - path: /opt/node/app + path: /opt/node/cache - name: certs host: path: /etc/ssl/certs - name: docker host: path: /var/run/docker.sock + + volumes: +