33 lines
941 B
YAML
33 lines
941 B
YAML
name: Mirror Repository
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
|
|
concurrency:
|
|
group: mirror-repository
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
mirror:
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- name: Gitee
|
|
repo: gitee.com/huanghongxun/HMCL
|
|
user: 'hmcl-sync'
|
|
token: 'GITEE_SYNC_TOKEN'
|
|
- name: CNB
|
|
repo: cnb.cool/HMCL-dev/HMCL
|
|
user: 'cnb'
|
|
token: 'CNB_SYNC_TOKEN'
|
|
name: Mirror to ${{ matrix.target.name }}
|
|
if: ${{ github.repository == 'HMCL-dev/HMCL' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Mirror GitHub to ${{ matrix.target.name }}
|
|
run: |
|
|
git clone --mirror "https://github.com/$GITHUB_REPOSITORY.git" -- repo
|
|
cd repo
|
|
git push -f --prune "https://${{ matrix.target.user }}:${{ secrets[matrix.target.token] }}@${{ matrix.target.repo }}.git" "refs/heads/*:refs/heads/*" "refs/tags/*:refs/tags/*"
|