30 lines
450 B
YAML
30 lines
450 B
YAML
image: docker:cli
|
|
|
|
services:
|
|
- docker:dind
|
|
|
|
stages:
|
|
- build
|
|
- deploy
|
|
|
|
build:
|
|
stage: build
|
|
script:
|
|
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
|
|
# Run this job in a branch where a Dockerfile exists
|
|
rules:
|
|
- if: $CI_COMMIT_BRANCH
|
|
exists:
|
|
- Dockerfile
|
|
|
|
deploy:
|
|
stage: deploy
|
|
script:
|
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
|
tags:
|
|
- docker
|
|
only:
|
|
- tags
|
|
when: on_success
|
|
|