Skip to content

Automatic sync with GitLab's read-only mirror #21

Automatic sync with GitLab's read-only mirror

Automatic sync with GitLab's read-only mirror #21

name: Automatic sync with GitLab's read-only mirror
on:
push:
branches:
- main
schedule:
- cron: '42 0 * * 0'
workflow_dispatch:
jobs:
mirror:
runs-on: ubuntu-latest
strategy:
matrix:
repo:
- {github: "https://github.com/rehlds/.github.git", gitlab: "[email protected]:rehlds/dot-github.git"}
- {github: "https://github.com/rehlds/rehlds.git", gitlab: "[email protected]:rehlds/rehlds.git"}
- {github: "https://github.com/rehlds/ReGameDLL_CS.git", gitlab: "[email protected]:rehlds/ReGameDLL_CS.git"}
- {github: "https://github.com/rehlds/metamod-r.git", gitlab: "[email protected]:rehlds/metamod-r.git"}
- {github: "https://github.com/rehlds/reapi.git", gitlab: "[email protected]:rehlds/reapi.git"}
- {github: "https://github.com/rehlds/rechecker.git", gitlab: "[email protected]:rehlds/rechecker.git"}
- {github: "https://github.com/rehlds/resemiclip.git", gitlab: "[email protected]:rehlds/resemiclip.git"}
- {github: "https://github.com/rehlds/reunion.git", gitlab: "[email protected]:rehlds/reunion.git"}
- {github: "https://github.com/rehlds/revoice.git", gitlab: "[email protected]:rehlds/revoice.git"}
- {github: "https://github.com/rehlds/relocalizebugfix.git", gitlab: "[email protected]:rehlds/relocalizebugfix.git"}
- {github: "https://github.com/rehlds/hitboxtracker.git", gitlab: "[email protected]:rehlds/hitboxtracker.git"}
- {github: "https://github.com/rehlds/testdemos.git", gitlab: "[email protected]:rehlds/testdemos.git"}
- {github: "https://github.com/rehlds/rehlds.github.io.git", gitlab: "[email protected]:rehlds/rehlds.github.io.git"}
- {github: "https://github.com/rehlds/metamod-r.org.git", gitlab: "[email protected]:rehlds/metamod-r.org.git"}
steps:
- name: Set up SSH key
env:
SSH_PRIVATE_KEY: ${{ secrets.GITLAB_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -t rsa,ed25519 github.com >> ~/.ssh/known_hosts
ssh-keyscan -t rsa,ed25519 gitlab.com >> ~/.ssh/known_hosts
- name: Clone repository as mirror
run: |
git clone --mirror ${{ matrix.repo.github }} repo-mirror
- name: Push to GitLab
run: |
cd repo-mirror
git remote set-url origin ${{ matrix.repo.gitlab }}
git push --mirror