Skip to content

Commit

Permalink
ci(gitlab): only release on a new tag created
Browse files Browse the repository at this point in the history
  • Loading branch information
lanathlor committed Dec 30, 2024
1 parent 91eb8a7 commit 5aedd9a
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]/StamusNetworks/stamusctl-templates.git"
- git push github HEAD:next


create-tags:
stage: release
Expand All @@ -120,4 +108,18 @@ create release:
- echo "running release_job"
release:
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
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:[email protected]/StamusNetworks/stamusctl-templates.git"
- git push github HEAD:next

0 comments on commit 5aedd9a

Please sign in to comment.