From 4578e39c2db51553d25f57e332d661a6213dbf60 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Sun, 12 May 2024 17:40:08 +0000 Subject: [PATCH] =?UTF-8?q?fix(CI):=20M=C3=A0J=20du=20fichier=20.gitlab-ci?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4e932e..5d7afe0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,23 +1,29 @@ -image: docker:stable - -variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 +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 - -after_script: - - docker images --filter "dangling=true" -q --no-trunc | xargs -r docker rmi + when: on_success