simplify caching in gitlab-ci
This commit is contained in:
parent
b0ddd983c3
commit
7489fe8e5d
1 changed files with 7 additions and 22 deletions
|
@ -1,39 +1,24 @@
|
|||
image: node:latest
|
||||
|
||||
stages:
|
||||
- Preparation
|
||||
- Build
|
||||
- Test
|
||||
|
||||
Install Dependencies:
|
||||
stage: Preparation
|
||||
cache:
|
||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
||||
paths:
|
||||
- node_modules/
|
||||
script:
|
||||
- npm ci
|
||||
# only:
|
||||
# changes:
|
||||
# - package-lock.json
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- .npm/
|
||||
|
||||
before_script:
|
||||
- npm ci --cache .npm --prefer-offline
|
||||
|
||||
Build:
|
||||
stage: Build
|
||||
cache:
|
||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
||||
paths:
|
||||
- node_modules/
|
||||
policy: pull
|
||||
script:
|
||||
- npm run build
|
||||
|
||||
Lint:
|
||||
stage: Test
|
||||
cache:
|
||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
||||
paths:
|
||||
- node_modules/
|
||||
policy: pull
|
||||
script:
|
||||
- npm run lint
|
||||
# Test:
|
||||
|
|
Loading…
Reference in a new issue