File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments