From baa590f7469d76a9e1fd9a8fb7a72e3e0f39c8ce Mon Sep 17 00:00:00 2001 From: AKP Date: Sat, 8 Feb 2025 23:21:27 +0000 Subject: [PATCH] Add .gitlab-ci.yml --- .gitlab-ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d9cbcce --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +workflow: + rules: + - if: '$CI_COMMIT_BRANCH == "build"' + +stages: + - build + +default: + image: docker + services: + - docker:dind + +buildAndPush: + stage: build + before_script: + - "echo $CI_REGISTRY_PASSWORD | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin" + - "docker info" + script: + - "docker build . --file Dockerfile --tag ${CI_REGISTRY_IMAGE}:latest --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}" + - "docker push --all-tags $CI_REGISTRY_IMAGE" \ No newline at end of file