.gitlab-ci.yml: Merge to main after successful stage pipeline

main
Mike Gerwitz 2021-10-06 14:08:23 -04:00
parent 7f5064c665
commit 072a501ed5
1 changed files with 16 additions and 0 deletions

View File

@ -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