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
|
image: node:latest
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- Preparation
|
|
||||||
- Build
|
- Build
|
||||||
- Test
|
- Test
|
||||||
|
|
||||||
Install Dependencies:
|
|
||||||
stage: Preparation
|
|
||||||
cache:
|
cache:
|
||||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- .npm/
|
||||||
script:
|
|
||||||
- npm ci
|
before_script:
|
||||||
# only:
|
- npm ci --cache .npm --prefer-offline
|
||||||
# changes:
|
|
||||||
# - package-lock.json
|
|
||||||
|
|
||||||
Build:
|
Build:
|
||||||
stage: Build
|
stage: Build
|
||||||
cache:
|
|
||||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
|
||||||
paths:
|
|
||||||
- node_modules/
|
|
||||||
policy: pull
|
|
||||||
script:
|
script:
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
||||||
Lint:
|
Lint:
|
||||||
stage: Test
|
stage: Test
|
||||||
cache:
|
|
||||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
|
||||||
paths:
|
|
||||||
- node_modules/
|
|
||||||
policy: pull
|
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
# Test:
|
# Test:
|
||||||
|
|
Loading…
Reference in a new issue