This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
simple-blog-api/.gitlab-ci.yml
2021-06-03 12:18:51 +00:00

36 lines
894 B
YAML

# This file is a template, and might need editing before it works on your project.
docker-build:
# Official docker image.
image: docker:20.10.6
stage: build
tags:
- docker
services:
- docker:20.10.6-dind
before_script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
docker-build-master:
# Official docker image.
image: docker:20.10.6
stage: build
tags:
- docker
services:
- docker:20.10.6-dind
before_script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master