From 5aedd9a6ecda7830102a36dbd05dfca30337157b Mon Sep 17 00:00:00 2001 From: lanath Date: Mon, 30 Dec 2024 09:06:44 +0100 Subject: [PATCH] ci(gitlab): only release on a new tag created --- .gitlab-ci.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c49199b..6efde60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,18 +84,6 @@ clearndr: - docker push ${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_SHORT_SHA} - docker push ${CI_REGISTRY_IMAGE}/clearndr:${CI_COMMIT_REF_NAME} -release-to-github: - stage: release - image: bitnami/git - rules: - - if: '$CI_COMMIT_REF_NAME == "latest"' - when: on_success - script: - - git config --global user.email $GITLAB_USER_EMAIL - - git config --global user.name $GITLAB_USER_NAME - - git remote add github "https://$GITHUB_USERNAME:$GITHUB_PAT@github.com/StamusNetworks/stamusctl-templates.git" - - git push github HEAD:next - create-tags: stage: release @@ -120,4 +108,18 @@ create release: - echo "running release_job" release: tag_name: '$CI_COMMIT_TAG' - description: '$CI_COMMIT_TAG' \ No newline at end of file + description: '$CI_COMMIT_TAG' + +release-to-github: + stage: release + image: bitnami/git + needs: + - create-tags + rules: + - if: '$CI_COMMIT_REF_NAME == "latest"' + when: on_success + script: + - git config --global user.email $GITLAB_USER_EMAIL + - git config --global user.name $GITLAB_USER_NAME + - git remote add github "https://$GITHUB_USERNAME:$GITHUB_PAT@github.com/StamusNetworks/stamusctl-templates.git" + - git push github HEAD:next