Mirror contents from GitLab #9254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |