-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (40 loc) · 938 Bytes
/
.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
image: node:14
cache:
paths:
- node_modules/
- .next/
stages:
- install
- build
- deploy
node_modules:
stage: install
script:
- yarn install
artifacts:
paths:
- node_modules
except:
- triggers
- tags
build:
stage: build
script:
- yarn build
artifacts:
paths:
- .next
deploy:
stage: deploy
only:
- main
- stable
- /^release-.*$/
image: docker:git # use simply git docker image
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/$CI_PROJECT_PATH .
- docker tag registry.gitlab.com/$CI_PROJECT_PATH registry.gitlab.com/$CI_PROJECT_PATH:$CI_COMMIT_REF_NAME
- docker push registry.gitlab.com/$CI_PROJECT_PATH:$CI_COMMIT_REF_NAME