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:
|
cache:
|
||||||
stage: Preparation
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
cache:
|
paths:
|
||||||
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
|
- .npm/
|
||||||
paths:
|
|
||||||
- node_modules/
|
before_script:
|
||||||
script:
|
- npm ci --cache .npm --prefer-offline
|
||||||
- npm ci
|
|
||||||
# only:
|
|
||||||
# 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