Skip to content

Mirror Sync

Mirror Sync #652

# Sync repo to the Codeberg mirror
name: Mirror Sync
on:
push:
branches: [ "main" ]
workflow_dispatch: # Manual dispatch
schedule:
- cron: "0 */8 * * *"
permissions: {}
jobs:
codeberg:
if: "github.repository == 'keiyoushi/extensions-source'"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.CODEBERG_SSH }}" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Mirror repository
run: |
git remote add mirror "git@codeberg.org:keiyoushi/extensions-source.git"
git push --force --prune mirror "refs/remotes/origin/main:refs/heads/main"
env:
GIT_SSH_COMMAND: "ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -l git"