Last active
January 13, 2020 14:13
-
-
Save vankop/97ebc6053d3ddeba0cf5497c192c8fd9 to your computer and use it in GitHub Desktop.
Cache root npm folder in GitLab CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build: | |
image: node:10-alpine | |
stage: build | |
cache: | |
key: "$CI_JOB_NAME" | |
paths: | |
- cache | |
except: | |
- tags | |
before_script: | |
- mv cache /root/.npm || echo "No cache found" | |
- npm set progress=false | |
- npm config set depth 0 | |
script: | |
- npm ci | |
after_script: | |
- mv /root/.npm cache || echo "No cache found" | |
artifacts: | |
paths: | |
- node_modules | |
expire_in: 20 minutes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment