-
Notifications
You must be signed in to change notification settings - Fork 12
/
.gitlab-ci.yml
55 lines (50 loc) · 1.09 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
stages:
- build
- test
- docker
- deploy
# include private configs for the remaining stages
include:
- project: "mirrors/ci-config"
file: "/testnet/deploy_webapp.yml"
variables:
# nginx configuration for this webapp
NGINX_CONFIG: |
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $$uri $$uri/ /index.html;
}
}
build:
stage: build
image: node:16
artifacts:
paths:
- dist/
cache:
key: node-cache
paths:
- node_modules/
script:
- yarn install
- build=testnet yarn build
# Make sure the dist directory exists, so that _this_ job fails and not the next one
- test -d dist || (echo "No dist directory\!" && exit 1)
- test -f dist/index.html || (echo "No files in dist\!" && exit 1)
allow_failure: false
test:
stage: test
image: node:16
cache:
key: node-cache
paths:
- node_modules/
script:
- yarn lint
- yarn test
allow_failure: true