diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2357a67f6e17eda15582d14673f0baa514efec05..60f91782d51dc6b1d3c8dc835167ef46cad9d438 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -49,10 +49,13 @@ build:
     - docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
     # push image tagged with its sha
     - docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
-    # push image tagged with its versions
-    - docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG"
-    # push image tagged with its versions and the commit sha (debug purpose)
-    - docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
+    - |
+      if [ "main" == "${CI_COMMIT_REF_SLUG}" ]; then
+        # push image tagged with its versions
+        docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG"
+        # push image tagged with its versions and the commit sha (debug purpose)
+        docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
+      fi
   parallel:
     matrix:
       - R_VERSION: ["latest"]