Skip to content

Commit cafaaa1

Browse files
committed
Add github workflow to automatically sync to gitlab.com repo
1 parent e253a8f commit cafaaa1

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Mirror to GitLab
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '**'
9+
workflow_dispatch:
10+
11+
jobs:
12+
mirror:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Install GitLab deploy key
17+
uses: webfactory/ssh-agent@v0.9.0
18+
with:
19+
ssh-private-key: ${{ secrets.RETROSHARE_GITLAB_MIRROR_SSH_KEY }}
20+
21+
- name: Trust GitLab host key
22+
run: |
23+
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
24+
25+
- name: Mirror repository to GitLab
26+
run: |
27+
git clone --mirror "https://github.com/${GITHUB_REPOSITORY}.git" repo.git
28+
cd repo.git
29+
git remote set-url --push origin git@gitlab.com:RetroShare/libretroshare.git
30+
git push --mirror

0 commit comments

Comments
 (0)