From 337854b0520148b809b86fafcbf43e6152ccc2ab Mon Sep 17 00:00:00 2001
From: Alex <alex.loo@protonmail.com>
Date: Mon, 6 Dec 2021 17:09:48 +0100
Subject: [PATCH] ci: add tag params to image building

---
 .gitlab-ci.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b2eb7a4b..2c4c4e11 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,10 +15,12 @@ build:
   stage: build
   services:
     - docker:18.09.6-dind
+  before_script:
+    - export TAG=${CI_COMMIT_TAG:-latest}
   script:
     - ./build.sh
     - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.e-biz.fr
     - docker build . -t $CI_REGISTRY_IMAGE
-    - docker push $CI_REGISTRY_IMAGE
+    - docker push $CI_REGISTRY_IMAGE:$TAG
   only:
     - master
-- 
GitLab