From 6323e9fb6e8f9ec4448297b2164c908e5de84447 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89lo=C3=AFs?= <elois@ifee.fr>
Date: Sun, 3 Dec 2017 00:41:11 +0000
Subject: [PATCH] Add github-sync

---
 .gitlab-ci.yml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..6433af71b
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,20 @@
+stages:
+    - github-sync
+
+push_to_github:
+    stage: github-sync
+    variables:
+        GIT_STRATEGY: none
+    tags:
+        - github
+    script:
+        - rm -rf ./*
+        - rm -rf .git
+        - git clone --mirror $CI_REPOSITORY_URL .
+        - git remote add github $GITHUB_URL_AND_KEY
+        - git config --global user.email "contact@duniter.org"
+        - git config --global user.name "Duniter"
+        # Job would fail if we don't remove refs about pull requests
+        - bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'"
+        - mv packed-refs-new packed-refs
+        - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
-- 
GitLab