-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci-frontend.yml
54 lines (45 loc) · 1.14 KB
/
.gitlab-ci-frontend.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
variables:
# Common variables to be able to build and push docker images
# https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-disabled
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
# To make npm test to not to start in watch mode
# https://create-react-app.dev/docs/running-tests/#continuous-integration
CI: "true"
cache:
paths:
- node_modules/
- build/
stages:
- test
- package
frontend:
image: node:12-alpine
stage: test
script:
- apk add git
- npm install
- npm test
package-frontend:
image: node:12-alpine
services:
- docker:19.03.1-dind
stage: package
variables:
# FIXME: eslint is failing so we need to unset this here to avoid
# Treating warnings as errors because process.env.CI = true.
CI: "false"
script:
- apk add docker git
- docker login -u gitlabci -p $CI_JOB_TOKEN $CI_REGISTRY
- npm install
- npm run build
- npm run docker:build
- npm run docker:push
only:
refs:
- ADD-DEPLOY-PROD-CONFIG
# Only run on develop, release/x.y.x and hotfix/xxxx
- develop
- /^release.*$/
- /^hotfix.*$/