added caching to pipeline

This commit is contained in:
peter
2019-07-07 17:48:05 +00:00
parent 90ad965b42
commit fc8cfaab34
+27 -1
View File
@@ -2,6 +2,17 @@ kind: pipeline
name: default
steps:
- name: restore cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- ./node_modules
volumes:
- name: cache
path: /cache
- name: npm install
image: node:12
commands:
@@ -12,6 +23,16 @@ steps:
commands:
- npm run build
- name: rebuild cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- ./node_modules
volumes:
- name: cache
path: /cache
- name: deliver container
image: plugins/docker
settings:
@@ -60,4 +81,9 @@ steps:
from_secret: docker_password
when:
event:
- tag
- tag
volumes:
- name: cache
host:
path: /tmp