-
Notifications
You must be signed in to change notification settings - Fork 56
/
.gitlab-ci.yml
63 lines (59 loc) · 1.45 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
stages:
- build
- test
- publish
build:
stage: build
only:
- tags
cache:
key: build-cache
paths:
- node_modules/
- lib/
- .npmrc
policy: push
script:
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}">.npmrc
- docker run -v $(pwd):/app -v /home:/home -w="/app" -u="$(id -u):$(id -g)" -e HOME node:14 npm install
- docker run -v $(pwd):/app -v /home:/home -w="/app" -u="$(id -u):$(id -g)" -e HOME node:14 npm run build
test:
stage: test
only:
- tags
cache:
key: build-cache
paths:
- node_modules/
- lib/
- .npmrc
policy: pull
script:
- docker run -v $(pwd):/app -v /home:/home -w="/app" -u="$(id -u):$(id -g)" -e HOME node:14 npm run test
lint:
stage: test
only:
- tags
cache:
key: build-cache
paths:
- node_modules/
- lib/
- .npmrc
policy: pull
script:
- docker run -v $(pwd):/app -v /home:/home -w="/app" -u="$(id -u):$(id -g)" -e HOME node:14 npm run lint
publish:
stage: publish
only:
- tags
cache:
key: build-cache
paths:
- node_modules/
- lib/
- .npmrc
policy: pull
script:
- docker run -v $(pwd):/app -v /home:/home -w="/app" -u="$(id -u):$(id -g)" -e HOME node:14 npm version --no-git-tag-version ${CI_COMMIT_TAG}
- docker run -v $(pwd):/app -v /home:/home -w="/app" -u="$(id -u):$(id -g)" -e HOME node:14 npm publish