Skip to content

Commit bc638af

Browse files
committed
Add git mirror action
1 parent af2652c commit bc638af

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/mirror.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Mirrors to https://tangled.sh/@kitten.sh (knot.kitten.sh)
2+
name: Mirror (Git Backup)
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
mirror:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
fetch-tags: true
16+
- name: Mirror
17+
env:
18+
MIRROR_SSH_KEY: ${{ secrets.MIRROR_SSH_KEY }}
19+
GIT_SSH_COMMAND: 'ssh -o StrictHostKeyChecking=yes'
20+
run: |
21+
mkdir -p ~/.ssh
22+
echo "$MIRROR_SSH_KEY" > ~/.ssh/id_rsa
23+
chmod 600 ~/.ssh/id_rsa
24+
ssh-keyscan -H knot.kitten.sh >> ~/.ssh/known_hosts
25+
git remote add mirror "[email protected]:kitten.sh/${GITHUB_REPOSITORY#*/}"
26+
git push --mirror mirror

0 commit comments

Comments
 (0)