From b0c630c9b6db6631cf6dbc0f9192ff447334a22e Mon Sep 17 00:00:00 2001 From: arcctgx Date: Sun, 26 May 2024 01:54:00 +0200 Subject: [PATCH] set up repository mirroring Set up GitHub Action to automatically sync changes to master branch to ARver mirrors at GitLab and Codeberg. It is not possible to sync both GitLab and Codeberg using one checkout, because the action attempts to create a remote named "mirror" twice in the same repository clone, which fails. For this reason two separate sync jobs are required. Checking host keys is disabled because of yesolutions/mirror-action#14. --- .github/workflows/sync-mirrors.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/sync-mirrors.yml diff --git a/.github/workflows/sync-mirrors.yml b/.github/workflows/sync-mirrors.yml new file mode 100644 index 0000000..44238ee --- /dev/null +++ b/.github/workflows/sync-mirrors.yml @@ -0,0 +1,41 @@ +name: Sync mirrors + +on: + push: + branches: + - master + +jobs: + sync-gitlab: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Sync GitLab mirror + uses: yesolutions/mirror-action@v0.7.0 + with: + REMOTE: 'ssh://git@gitlab.com/arcctgx/ARver.git' + GIT_SSH_PRIVATE_KEY: ${{ secrets.ARVER_SYNC_PRIVATE_SSH_KEY }} + GIT_SSH_NO_VERIFY_HOST: true + PUSH_ALL_REFS: false + + sync-codeberg: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Sync Codeberg mirror + uses: yesolutions/mirror-action@v0.7.0 + with: + REMOTE: 'ssh://git@codeberg.org/arcctgx/ARver.git' + GIT_SSH_PRIVATE_KEY: ${{ secrets.ARVER_SYNC_PRIVATE_SSH_KEY }} + GIT_SSH_NO_VERIFY_HOST: true + PUSH_ALL_REFS: false