diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69b35123dac7074b2848bc21321ca896c3e36bce..8aecc3c00d26e54a0f54b4b26892a426ac2b1d30 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,3 +46,20 @@ pages: # Compress # https://docs.gitlab.com/ee/user/project/pages/introduction.html#serving-compressed-assets # https://blog.ideotec.es/support-compression-gitlab-pages/ + +# --------------------------------------------------- +# 🚀 Mirror changes to GitHub (only from default branch) +# --------------------------------------------------- +mirror_to_github: + image: alpine:latest + stage: deploy + script: + - apk add --no-cache git + - 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