-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
79 lines (74 loc) · 1.95 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
stages:
- test
- build
- deploy
lint:
image: node:20.17.0-alpine
stage: test
allow_failure: true
tags:
- docker-compose
- prod
script:
- npm ci
- npm run lint
build dev:
stage: build
image: atnartur/docker:latest
tags:
- docker-compose
- dev
variables:
VITE_API_URL: $DEV__VITE_API_URL
VITE_SITE_URL: $DEV__VITE_SITE_URL
VITE_PAYPAL_CLIENT_ID: $DEV__VITE_PAYPAL_CLIENT_ID
VITE_GOOGLE_SSO_CLIENT_ID: $DEV__VITE_GOOGLE_SSO_CLIENT_ID
VITE_FACEBOOK_SSO_CLIENT_ID: $DEV__VITE_FACEBOOK_SSO_CLIENT_ID
except:
- main
script:
- docker-compose -f docker-compose.dev.yml build
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker-compose -f docker-compose.dev.yml push
build prod:
stage: build
image: atnartur/docker:latest
tags:
- docker-compose
- prod
variables:
VITE_API_URL: $PROD__VITE_API_URL
VITE_SITE_URL: $PROD__VITE_SITE_URL
VITE_PAYPAL_CLIENT_ID: $PROD__VITE_PAYPAL_CLIENT_ID
VITE_GOOGLE_SSO_CLIENT_ID: $PROD__VITE_GOOGLE_SSO_CLIENT_ID
VITE_FACEBOOK_SSO_CLIENT_ID: $PROD__VITE_FACEBOOK_SSO_CLIENT_ID
only:
- main
script:
- docker-compose -f docker-compose.prod.yml build
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker-compose -f docker-compose.prod.yml push
deploy dev:
stage: deploy
image: atnartur/docker:latest
only:
- dev
tags:
- docker-compose
- dev
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker-compose -f docker-compose.dev.yml pull
- docker-compose -f docker-compose.dev.yml up -d --remove-orphans
deploy prod:
stage: deploy
image: atnartur/docker:latest
only:
- main
tags:
- docker-compose
- prod
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker-compose -f docker-compose.prod.yml pull
- docker-compose -f docker-compose.prod.yml up -d --remove-orphans