MEGAlib mirror #4703
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
# .github/workflows/mirror.yml | |
# This workflow mirrors the MEGAlib repository | |
name: 'MEGAlib mirror' | |
on: | |
# Update the mirror when | |
# 1. this mirror branch is updates, i.e. run it immediatly on first push | |
push: | |
branches: | |
- cositools-megalib-mirror | |
# 2. on a daily schedule, every 4 hours | |
schedule: | |
- cron: '0 */4 * * *' | |
# 3. Manually from the API/CLI/UI | |
workflow_dispatch: | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
name: mirror | |
steps: | |
- name: mirror | |
run: | | |
git clone --bare "https://x-access-token:${{ secrets.MIRROR }}@github.com/${GITHUB_REPOSITORY}.git" . || exit 1 | |
git remote add --mirror=fetch mirror "https://github.com/zoglauer/megalib" || exit 1 | |
git fetch mirror +refs/heads/*:refs/remotes/origin/* || exit 1 | |
git push --force --mirror --prune origin || exit 1 | |