diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c1f0090 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +workflow: + rules: + - if: '$CI_COMMIT_BRANCH == "build"' + +stages: + - build + +default: + image: docker + services: + - docker:dind + before_script: + - "echo $CI_REGISTRY_PASSWORD | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin" + - "docker info" + +buildAndPublish: + stage: build + variables: + IMAGE_NAME: "${CI_REGISTRY_IMAGE}" + script: + - "docker build . --tag ${IMAGE_NAME}:latest --tag ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA#'v'}" + - "docker push --all-tags $IMAGE_NAME"