Commit 91ed3d6d authored by Wouter's avatar Wouter

GitLab CI: use gitmirror image to sync to GitHub

parent 57eab5d2
......@@ -6,21 +6,11 @@ stages:
Mirror to github:
stage: mirror
image: haffmans/git-mirror:latest
script:
- mkdir -p $HOME/.ssh
- echo "${GITHUB_DEPLOY_KEY}" > $HOME/.ssh/github
- chmod 0600 $HOME/.ssh/github
- mv $HOME/.ssh/config $HOME/.ssh/config~ || /bin/true
- echo "host github.com" > $HOME/.ssh/config
- echo " IdentityFile %d/.ssh/github" >> $HOME/.ssh/config
- echo " PubKeyAuthentication yes" >> $HOME/.ssh/config
- git remote add --mirror=push github git@github.com:${GITHUB_REPOSITORY} || /bin/true
- git push github
after_script:
- mv $HOME/.ssh/config~ $HOME/.ssh/config || /bin/true
- rm $HOME/.ssh/github
- git-mirror "${CI_PROJECT_DIR}" git@github.com:${GITHUB_REPOSITORY}
tags:
- gitmirror
Build master:
stage: build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment