-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
59 lines (55 loc) · 1.41 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
image: node:10.5.0-alpine
stages:
- test
- test
- deploy
before_script:
- echo 'Using Node.js version' $(node -v)
- echo 'Using npm version' $(npm -v)
test:
stage: test
variables:
APP_ENV: "test"
NODE_ENV: "test"
CODACY_PROJECT_TOKEN: $CODACY_PROJECT_TOKEN
script:
- npm ci
- npm test
- cat ./coverage/lcov.info | ./node_modules/.bin/codacy-coverage -t $CODACY_PROJECT_TOKEN -v -c $CI_COMMIT_SHA
dependency_scanning:
stage: test
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
artifacts:
paths: [gl-dependency-scanning-report.json]
pages: # the job must be named pages
stage: deploy
script:
- npm ci
- npm run build
- mv storybook-dist public
artifacts:
paths:
- public
environment:
name: production
only:
- tags
publish:
stage: deploy
script:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- npm publish --access public
only:
- tags