Automatic sync with read-only mirrors #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatic sync with read-only mirrors | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '42 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
repo: | |
# - {github: "", bitbucket: "", codeberg: "", gitlab: "" } | |
- {github: "https://github.com/rehlds/.github.git", bitbucket: "git@bitbucket.org:rehlds-dev/.github.git", codeberg: "git@codeberg.org:reHLDS/.github.git", gitlab: "git@gitlab.com:rehlds/dot-github.git"} | |
- {github: "https://github.com/rehlds/rehlds.git", bitbucket: "git@bitbucket.org:rehlds-dev/rehlds.git", codeberg: "git@codeberg.org:reHLDS/rehlds.git", gitlab: "git@gitlab.com:rehlds/rehlds.git"} | |
- {github: "https://github.com/rehlds/ReGameDLL_CS.git", bitbucket: "git@bitbucket.org:rehlds-dev/regamedll_cs.git", codeberg: "git@codeberg.org:reHLDS/ReGameDLL_CS.git", gitlab: "git@gitlab.com:rehlds/ReGameDLL_CS.git"} | |
- {github: "https://github.com/rehlds/metamod-r.git", bitbucket: "git@bitbucket.org:rehlds-dev/metamod-r.git", codeberg: "git@codeberg.org:reHLDS/metamod-r.git", gitlab: "git@gitlab.com:rehlds/metamod-r.git"} | |
- {github: "https://github.com/rehlds/reapi.git", bitbucket: "git@bitbucket.org:rehlds-dev/reapi.git", codeberg: "git@codeberg.org:reHLDS/reapi.git", gitlab: "git@gitlab.com:rehlds/reapi.git"} | |
- {github: "https://github.com/rehlds/rechecker.git", bitbucket: "git@bitbucket.org:rehlds-dev/rechecker.git", codeberg: "git@codeberg.org:reHLDS/rechecker.git", gitlab: "git@gitlab.com:rehlds/rechecker.git"} | |
- {github: "https://github.com/rehlds/resemiclip.git", bitbucket: "git@bitbucket.org:rehlds-dev/resemiclip.git", codeberg: "git@codeberg.org:reHLDS/resemiclip.git", gitlab: "git@gitlab.com:rehlds/resemiclip.git"} | |
- {github: "https://github.com/rehlds/reunion.git", bitbucket: "git@bitbucket.org:rehlds-dev/reunion.git", codeberg: "git@codeberg.org:reHLDS/reunion.git", gitlab: "git@gitlab.com:rehlds/reunion.git"} | |
- {github: "https://github.com/rehlds/revoice.git", bitbucket: "git@bitbucket.org:rehlds-dev/revoice.git", codeberg: "git@codeberg.org:reHLDS/revoice.git", gitlab: "git@gitlab.com:rehlds/revoice.git"} | |
- {github: "https://github.com/rehlds/relocalizebugfix.git", bitbucket: "git@bitbucket.org:rehlds-dev/relocalizebugfix.git", codeberg: "git@codeberg.org:reHLDS/relocalizebugfix.git", gitlab: "git@gitlab.com:rehlds/relocalizebugfix.git"} | |
- {github: "https://github.com/rehlds/hitboxtracker.git", bitbucket: "git@bitbucket.org:rehlds-dev/hitboxtracker.git", codeberg: "git@codeberg.org:reHLDS/hitboxtracker.git", gitlab: "git@gitlab.com:rehlds/hitboxtracker.git"} | |
- {github: "https://github.com/rehlds/testdemos.git", bitbucket: "git@bitbucket.org:rehlds-dev/testdemos.git", codeberg: "git@codeberg.org:reHLDS/testdemos.git", gitlab: "git@gitlab.com:rehlds/testdemos.git"} | |
- {github: "https://github.com/rehlds/rehlds.github.io.git", bitbucket: "git@bitbucket.org:rehlds-dev/rehlds.github.io.git", codeberg: "git@codeberg.org:reHLDS/rehlds.github.io.git", gitlab: "git@gitlab.com:rehlds/rehlds.github.io.git"} | |
- {github: "https://github.com/rehlds/metamod-r.org.git", bitbucket: "git@bitbucket.org:rehlds-dev/metamod-r.org.git", codeberg: "git@codeberg.org:reHLDS/metamod-r.org.git", gitlab: "git@gitlab.com:rehlds/metamod-r.org.git"} | |
- {github: "https://github.com/rehlds/metamod-r-game-tests.git", bitbucket: "git@bitbucket.org:rehlds-dev/metamod-r-game-tests.git", codeberg: "git@codeberg.org:reHLDS/metamod-r-game-tests.git", gitlab: "git@gitlab.com:rehlds/metamod-r-game-tests.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 bitbucket.org >> ~/.ssh/known_hosts | |
ssh-keyscan -t rsa,ed25519 codeberg.org >> ~/.ssh/known_hosts | |
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 BitBucket | |
run: | | |
cd repo-mirror | |
git remote set-url origin ${{ matrix.repo.bitbucket }} | |
git push --mirror --force | |
- name: Push to CodeBerg | |
run: | | |
cd repo-mirror | |
git remote set-url origin ${{ matrix.repo.codeberg }} | |
git push --mirror --force | |
- name: Push to GitLab | |
run: | | |
cd repo-mirror | |
git remote set-url origin ${{ matrix.repo.gitlab }} | |
git push --mirror --force |