-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
115 lines (100 loc) · 2.11 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
image: node:12-alpine
stages:
- setup
- test
- build
- deploy
- security
.caching:
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
policy: pull
setup:cache:
stage: setup
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
script:
- echo '//npm.superpitch.fr/:_authToken="${NPM_TOKEN}"' > .npmrc
- npm install --registry https://npm.superpitch.fr
only:
changes:
- package-lock.json
#- package.json
test:lint:
extends: .caching
stage: test
script:
- npm run lint
test:unit:
extends: .caching
stage: test
script:
- npm run test
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
security:npm_dependency_scanning:
extends: .caching
stage: security
tags:
- secscan
allow_failure: true
script:
- npm audit --audit-level=moderate --json | npx gitlab-npm-audit-parser -o gl-dependency-scanning-report.json
artifacts:
reports:
dependency_scanning: gl-dependency-scanning-report.json
build:docs:
extends: .caching
stage: build
script:
- npm run docs
artifacts:
paths:
- docs
only:
- master
- triggers
build:dist:
extends: .caching
stage: build
script:
- npm run prebuild
- npm run build
artifacts:
paths:
- dist
only:
- tags
- triggers
when: on_success
deploy:publish:
stage: deploy
before_script:
- echo '//npm.superpitch.fr/:_authToken="${NPM_TOKEN}"' > .npmrc
only:
- tags
- triggers
when: on_success
script:
- npm publish --registry https://npm.superpitch.fr
dependencies:
- build:dist
pages:
stage: deploy
before_script:
- echo ''
script:
- mkdir .public
- cp -r docs/* .public
- mv .public public
artifacts:
paths:
- public
only:
- master
- triggers
dependencies:
- build:docs