forked from x-c-f/xcf-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
59 lines (53 loc) · 1.1 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
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:latest
stages:
- build
- test
- release
- deploy
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
GIT_SUBMODULE_STRATEGY: normal
build_vue:
stage: build
script:
- cd frontend
- npm install
- npm run build
artifacts:
paths:
- frontend/dist
expire_in: 1d
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- frontend/node_modules/
release:
stage: release
image: docker:latest
tags:
- docker
services:
- docker:dind
only:
- master
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_IMAGE
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
release-dev:
stage: release
image: docker:latest
tags:
- docker
services:
- docker:dind
only:
- dev
- beta
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_IMAGE
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG