From 5ec4f4d9a7d3a22fea252c3289d3ebb3c07e2669 Mon Sep 17 00:00:00 2001 From: Khor Shu Heng Date: Mon, 8 Mar 2021 10:15:34 +0800 Subject: [PATCH] Add mirroring for internal repository Signed-off-by: Khor Shu Heng --- .github/workflows/mirror.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/mirror.yml diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 0000000..2acd1cd --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,24 @@ +name: mirror + +on: + push: + branches: master + tags: + - 'v*.*.*' + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: webfactory/ssh-agent@v0.4.1 + with: + ssh-private-key: ${{ secrets.MIRROR_SSH_KEY }} + - name: Mirror all origin branches and tags to internal repo + run: | + export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + git remote add internal ${{ secrets.INTERNAL_REPO }} + git push internal --all -f + git push internal --tags -f