-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
102 lines (92 loc) · 1.82 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
stages:
- build
- linting
- deploy-production
.backend:
only:
changes:
- "packages/backend/**/*"
.web-app:
only:
changes:
- "packages/web-app/**/*"
backend-build:
stage: build
extends: .backend
image: node:18.7.0-buster
script:
- cd packages/backend
- npm i @nestjs/cli
- npm ci --cache .npm --prefer-offline
- npm run build
cache:
key: npm
paths:
- .npm/
artifacts:
expire_in: 2 days
paths:
- packages/backend/node_modules/
web-app-build:
stage: build
extends: .web-app
image: node:18.7.0-buster
script:
- cd packages/web-app
- npm ci --cache .npm --prefer-offline
- npm run build:prod
cache:
key: npm
paths:
- .npm/
artifacts:
expire_in: 2 days
paths:
- packages/web-app/node_modules/
backend-linting:
stage: linting
extends: .backend
needs:
- backend-build
script:
- cd packages/backend
- npm run lint-ci
web-app-linting:
stage: linting
extends: .web-app
needs:
- web-app-build
script:
- cd packages/web-app
- npm run lint
backend-deploy-production:
stage: deploy-production
extends: .backend
image:
name: docker/compose:latest
script:
- cd packages/backend
- docker-compose -f docker-compose.production.yml up --build -d
only:
- main
neuronet-deploy-production:
stage: deploy-production
needs:
- backend-deploy-production
image:
name: docker/compose:latest
script:
- cd packages/machine-learning
- docker-compose -f docker-compose.production.yml up --build -d
only:
- main
web-app-deploy-production:
stage: deploy-production
extends: .web-app
image:
name: docker/compose:latest
script:
- cd packages/web-app
- docker-compose -f docker-compose.production.yml up --build -d
only:
- main