Skip to content

Commit

Permalink
set up repository mirroring
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arcctgx committed May 26, 2024
1 parent c9b5fee commit b0c630c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/sync-mirrors.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
REMOTE: 'ssh://[email protected]/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/[email protected]
with:
REMOTE: 'ssh://[email protected]/arcctgx/ARver.git'
GIT_SSH_PRIVATE_KEY: ${{ secrets.ARVER_SYNC_PRIVATE_SSH_KEY }}
GIT_SSH_NO_VERIFY_HOST: true
PUSH_ALL_REFS: false

0 comments on commit b0c630c

Please sign in to comment.