-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 847 Bytes
/
Copy pathmirror.yml
File metadata and controls
30 lines (28 loc) · 847 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
name: Mirror contents from GitLab
on:
schedule:
- cron: '37 */4 * * *'
push:
branches:
- mirror
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Fetch the Makefile
run: curl -L "https://gitlab.com/sio/server_common/-/raw/master/Makefile" -o Makefile
- name: Fetch ssh key
env:
KEY: ${{ secrets.PRIVATE_KEY }}
# Private key is stored in repository secrets under "PRIVATE_KEY"
# Public key is stored in repository deploy keys under "Mirror from GitLab",
# write access has to be granted for that deploy key
run: |
umask 077
mkdir -p ~/.ssh || true
echo "$KEY" > ~/.ssh/id_rsa
- name: Mirror git repository
run: make mirror
- name: Remove ssh key
run:
echo > ~/.ssh/id_rsa