-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
33 lines (27 loc) · 691 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
image: docker:git
variables:
DOCKER_DRIVER: overlay2
DB: docker build --pull --no-cache --force-rm=true
services:
- docker:dind
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
stages:
- build
build-master:
stage: build
script:
- $DB -t $CI_REGISTRY_IMAGE .
- git config user.email $GITHUB_EMAIL
- git config user.name $GITHUB_USER
- git push https://$GITHUB_USER:[email protected]/$GITHUB_USER/$CI_PROJECT_NAME.git HEAD:master --force
only:
- master
build:
stage: build
script:
- $DB -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
except:
- master