-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
59 lines (53 loc) · 1.18 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
59 lines (53 loc) · 1.18 KB
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
stages:
- install
- lint
- test
- build
- docker
variables:
NODE_ENV: "test"
DOCKER_IMAGE_NAME: "tasksphere-web"
DOCKER_TAG: "${CI_COMMIT_SHORT_SHA}"
install_dependencies:
stage: install
image: node:22-alpine
script:
- cd backend && npm ci
- cd ../frontend && npm ci
artifacts:
paths:
- backend/node_modules/
- frontend/node_modules/
lint_frontend:
stage: lint
image: node:22-alpine
script:
- cd frontend && npm run lint
test_backend:
stage: test
image: node:22-alpine
script:
- cd backend && npm test
build_frontend:
stage: build
image: node:22-alpine
script:
- cd frontend && npm run build
artifacts:
paths:
- frontend/dist/
docker_build:
stage: docker
image: docker:24.0.5-dind
services:
- docker:24.0.5-dind
variables:
DOCKER_TLS_CERTDIR: ""
script:
- echo "Logging into Docker registry"
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build -t $DOCKER_IMAGE_NAME:$DOCKER_TAG -t $DOCKER_IMAGE_NAME:latest -f backend/Dockerfile .
- docker push $DOCKER_IMAGE_NAME:$DOCKER_TAG
- docker push $DOCKER_IMAGE_NAME:latest
only:
- main