Skip to content

Commit 1027ed0

Browse files
committed
Automatic sync with Gitlab's read-only mirror
1 parent 98879bd commit 1027ed0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Automatic sync with Gitlab's read-only mirror
2+
3+
on: [workflow_dispatch, push]
4+
5+
jobs:
6+
mirror:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Set up SSH key for Runner
14+
env:
15+
SSH_KEY: ${{ secrets.GITLAB_DEPLOY_KEY }}
16+
run: |
17+
mkdir -p ~/.ssh
18+
echo "$SSH_KEY" > ~/.ssh/id_ed25519
19+
chmod 600 ~/.ssh/id_ed25519
20+
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
21+
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
22+
23+
- name: Clone repository from GitHub as mirror and push to Gitlab
24+
env:
25+
REPO_ORIGINAL: "https://github.com/rehlds/metamod-r.git"
26+
REPO_TARGET: "[email protected]:rehlds/metamod-r.git"
27+
run: |
28+
git clone --mirror "$REPO_ORIGINAL" repo-mirror
29+
cd repo-mirror
30+
git remote set-url origin "$REPO_TARGET"
31+
git push --mirror --force

0 commit comments

Comments
 (0)