From 127e6994e1f5438d06509e326263eec3dbd728a7 Mon Sep 17 00:00:00 2001 From: ChronosXYZ Date: Thu, 19 Sep 2024 03:12:39 +0300 Subject: [PATCH] Add cache to drone config --- .drone.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 2f24bb7..4f41929 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,8 +2,21 @@ kind: pipeline name: default steps: + - name: restore-cache + image: meltwater/drone-cache:dev + settings: + pull: true + backend: "filesystem" + restore: true + archive_format: "gzip" + cache_key: "volume" + mount: + - "node_modules" + volumes: + - name: cache + path: /tmp/cache - name: build - image: node:20 + image: node:20-slim commands: - npm install - npm run build @@ -20,3 +33,18 @@ steps: from_secret: rsync_user key: from_secret: rsync_key + args: + - --delete + - name: rebuild-cache + image: meltwater/drone-cache + settings: + pull: true + rebuild: true + cache_key: "volume" + mount: + - "node_modules" + +volumes: + - name: cache + host: + path: /srv/drone/cache