diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8aecc3c00d26e54a0f54b4b26892a426ac2b1d30..2df79037eb9bbad4b788ef05e6844283623b22f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,18 +48,17 @@ pages: # https://blog.ideotec.es/support-compression-gitlab-pages/ # --------------------------------------------------- -# 🚀 Mirror changes to GitHub (only from default branch) +# Mirror changes to GitHub (only from default branch) # --------------------------------------------------- mirror_to_github: image: alpine:latest stage: deploy - script: + before_script: - apk add --no-cache git + script: - git config --global user.name "GitLab Mirror Bot" - git config --global user.email "mirror-bot@daic.tudelft.nl" - - git clone --mirror https://gitlab.ewi.tudelft.nl/daic/docs.git - - cd docs.git - git remote add github https://$GITHUB_TOKEN@github.com/daic-tud/docs.git - git push github --mirror - only: - - $CI_DEFAULT_BRANCH \ No newline at end of file + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH \ No newline at end of file