From 6f458b7628a478736eb66f9324da75c3c80198bb Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 10 Dec 2020 15:37:15 +0100 Subject: [PATCH] Add yarn cache to drone --- .drone.yml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7bbd1f6..f887f0f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,10 +12,32 @@ steps: commands: - git fetch --tags + - name: restore-cache + image: meltwater/drone-cache:dev + pull: true + environment: + AWS_ACCESS_KEY_ID: + from_secret: cache_aws_access_key_id + AWS_SECRET_ACCESS_KEY: + from_secret: cache_aws_secret_access_key + settings: + restore: true + bucket: kolaente.dev-drone-dependency-cache + endpoint: https://s3.fr-par.scw.cloud + region: fr-par + path_style: true + cache_key: '{{ .Repo.Name }}_{{ checksum "yarn.lock" }}_{{ arch }}_{{ os }}' + mount: + - '.cache' + - name: build image: electronuserland/builder:wine pull: true - depends_on: [ fetch-tags ] + environment: + YARN_CACHE_FOLDER: .cache/yarn/ + depends_on: + - fetch-tags + - restore-cache commands: - export VERSION=${DRONE_TAG##v} - if [ -z "$$VERSION" ]; then export VERSION=${DRONE_BRANCH}; fi @@ -28,6 +50,26 @@ steps: - yarn install - yarn dist --linux --windows + - name: rebuild-cache + image: meltwater/drone-cache:dev + pull: true + environment: + AWS_ACCESS_KEY_ID: + from_secret: cache_aws_access_key_id + AWS_SECRET_ACCESS_KEY: + from_secret: cache_aws_secret_access_key + settings: + rebuild: true + bucket: kolaente.dev-drone-dependency-cache + endpoint: https://s3.fr-par.scw.cloud + region: fr-par + path_style: true + cache_key: '{{ .Repo.Name }}_{{ checksum "yarn.lock" }}_{{ arch }}_{{ os }}' + mount: + - '.cache' + depends_on: + - build + - name: release-latest image: plugins/s3:1 pull: true