33 lines
600 B
YAML
33 lines
600 B
YAML
default:
|
|
image: node:latest
|
|
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
cache:
|
|
paths:
|
|
- node_modules/
|
|
|
|
before_script:
|
|
- npm ci
|
|
|
|
unit-tests:
|
|
stage: test
|
|
script:
|
|
- npm run test:unit
|
|
artifacts:
|
|
paths:
|
|
- coverage/
|
|
expire_in: 1 month
|
|
only:
|
|
- merge_requests
|
|
|
|
publish-npm:
|
|
stage: deploy
|
|
script:
|
|
- echo "@cellule-financiere-pmo:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
|
|
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
|
|
- npm publish
|
|
only:
|
|
- tags |