From 072a501ed533ed99b116f1f2b06eb22c489bbb96 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 6 Oct 2021 14:08:23 -0400 Subject: [PATCH] .gitlab-ci.yml: Merge to main after successful stage pipeline --- .gitlab-ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7a437fa..3a504264 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,3 +52,19 @@ pages: expire_in: 30 min only: - main + +ci:merge: + stage: deploy + script: + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - git config user.email "gitlab-ci@localhost" + - git config user.name "GitLab CI" + - git checkout main + - git reset --hard origin/main + - git merge --ff origin/stage + # Should trigger pipeline + - git push http://ci:$STAGE_MERGE_ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git HEAD:main + only: + - stage +