Skip to content

Mirror contents from GitLab #9266

Mirror contents from GitLab

Mirror contents from GitLab #9266

Workflow file for this run

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