Skip to content

mirror

mirror #704

Workflow file for this run

name: 'mirror'
on:
push:
branches:
- __mirror
schedule:
# Run everyday at 3 AM UTC
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: mirror
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone --bare "https://truenicoco:${GITHUB_TOKEN}@github.com/truenicoco/slidge" . || exit 1
git remote add --mirror=fetch mirror https://git.sr.ht/~nicoco/slidge || exit 1
git fetch mirror +refs/heads/*:refs/remotes/origin/* || exit 1
git push --force --mirror --prune origin || exit 1
- name: codeberg
env:
CODEBERG: ${{ secrets.CODEBERG }}
run: |
mkdir ~/.ssh
echo "${CODEBERG}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo Adding remote
git remote add codeberg [email protected]:nicoco/slidge.git
ssh-keyscan -t rsa codeberg.org >> ~/.ssh/known_hosts
echo Pushing...
git -c core.sshCommand="/usr/bin/ssh -i ~/.ssh/id_rsa" push --force --mirror --prune codeberg || exit 1
- name: gitlab
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: |
git remote add gitlab https://${GITLAB_TOKEN}@gitlab.com/nicocool84/slidge-mirror
git push --force --mirror --prune gitlab || exit 1