Add yarn cache to drone
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2020-12-10 15:37:15 +01:00
parent ec29cd90e6
commit 6f458b7628
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 43 additions and 1 deletions

View File

@ -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