Skip to content
Snippets Groups Projects
.gitlab-ci.yml 476 B
Newer Older
image: docker:23.0.3
Bartosz Walkowiak's avatar
Bartosz Walkowiak committed

stages:
  - build


build_image:
  stage: build
  image: docker:23.0.3
Bartosz Walkowiak's avatar
Bartosz Walkowiak committed
  services:
    - 'docker:23.0.3-dind'
  before_script:
    - until docker info; do sleep 1; done
Bartosz Walkowiak's avatar
Bartosz Walkowiak committed
  script:
Bartosz Walkowiak's avatar
Bartosz Walkowiak committed
    - if [ "$CI_COMMIT_REF_NAME" == "master" ]; then TAG="latest"; else TAG="develop"; fi
    - docker build -t $CI_REGISTRY_IMAGE:$TAG -o type=docker .
Bartosz Walkowiak's avatar
Bartosz Walkowiak committed
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
Bartosz Walkowiak's avatar
Bartosz Walkowiak committed
    - docker push $CI_REGISTRY_IMAGE:$TAG

Bartosz Walkowiak's avatar
Bartosz Walkowiak committed