-
-
Notifications
You must be signed in to change notification settings - Fork 37
39 lines (31 loc) · 987 Bytes
/
gitlab-mirror.yml
File metadata and controls
39 lines (31 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Push to GitLab Mirror
on:
push:
branches:
- master
jobs:
push_to_gitlab:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Install SSH key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan git.tosdr.org >> ~/.ssh/known_hosts
- name: Push to GitLab
run: |
# Add GitLab as a remote
git remote add gitlab git@git.tosdr.org:tosdr/phoenix.git
# Fetch full history
git fetch --unshallow
# Push to the mirror
git push --force gitlab master --tags