From dd27a0ddcdf91994a67f0ef57cdab833267c84cb Mon Sep 17 00:00:00 2001
From: Jedrzej Rybicki <j.rybicki@fz-juelich.de>
Date: Thu, 13 Jan 2022 11:35:50 +0100
Subject: [PATCH] adding publishgit task

---
 .gitlab-ci.yml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9fd074e..c330e9a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,3 +48,17 @@ deploy-test:
     - while [ "`openstack server show $INSTANCE_ID -c addresses -f value`" = "{}" ]; do sleep 5; done # wait until an address is available to attach the floating ip
     - openstack server add floating ip $INSTANCE_ID $FLOATING_IP
     - echo "Done"
+
+publishgit-do:
+  stage: publish
+  only:
+    - tags
+  tags: [stable]
+  script:
+    - apt-get update 
+    - apt-get install -y git
+    - (git remote -v | grep gith) || git remote add gith "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/eflows4hpc/data-logistics-service.git"
+    - git remote -v
+    - git show-ref
+    - export
+    - git push gith $CI_COMMIT_REF_NAME
-- 
GitLab