From 587de7535df177ad6dec6c5e97f7dc04a16f2ce6 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Thu, 14 Aug 2025 03:59:06 +0100 Subject: [PATCH] Add git mirror action --- .github/workflows/mirror.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/mirror.yml diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 0000000..97e5ea6 --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,26 @@ +# Mirrors to https://tangled.sh/@kitten.sh (knot.kitten.sh) +name: Mirror (Git Backup) +on: + push: + branches: + - main +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - name: Mirror + env: + MIRROR_SSH_KEY: ${{ secrets.MIRROR_SSH_KEY }} + GIT_SSH_COMMAND: 'ssh -o StrictHostKeyChecking=yes' + run: | + mkdir -p ~/.ssh + echo "$MIRROR_SSH_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -H knot.kitten.sh >> ~/.ssh/known_hosts + git remote add mirror "git@knot.kitten.sh:kitten.sh/${GITHUB_REPOSITORY#*/}" + git push --mirror mirror -- knotmirror 0.0.1