|
| 1 | +# SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | +name: Mirror to GitLab/Codeberg/Bitbucket |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [main, master] |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: read-all |
| 10 | + |
| 11 | +jobs: |
| 12 | + mirror-gitlab: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + if: vars.GITLAB_MIRROR_ENABLED == 'true' |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 |
| 20 | + with: |
| 21 | + ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }} |
| 22 | + - name: Mirror to GitLab |
| 23 | + run: | |
| 24 | + git remote add gitlab git@gitlab.com:hyperpolymath/${GITHUB_REPOSITORY#*/}.git || true |
| 25 | + git push gitlab --all --force |
| 26 | + git push gitlab --tags --force |
| 27 | +
|
| 28 | + mirror-codeberg: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + if: vars.CODEBERG_MIRROR_ENABLED == 'true' |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
| 35 | + - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 |
| 36 | + with: |
| 37 | + ssh-private-key: ${{ secrets.CODEBERG_SSH_KEY }} |
| 38 | + - name: Mirror to Codeberg |
| 39 | + run: | |
| 40 | + git remote add codeberg git@codeberg.org:hyperpolymath/${GITHUB_REPOSITORY#*/}.git || true |
| 41 | + git push codeberg --all --force |
| 42 | + git push codeberg --tags --force |
| 43 | +
|
| 44 | + mirror-bitbucket: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + if: vars.BITBUCKET_MIRROR_ENABLED == 'true' |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 |
| 49 | + with: |
| 50 | + fetch-depth: 0 |
| 51 | + - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 |
| 52 | + with: |
| 53 | + ssh-private-key: ${{ secrets.BITBUCKET_SSH_KEY }} |
| 54 | + - name: Mirror to Bitbucket |
| 55 | + run: | |
| 56 | + git remote add bitbucket git@bitbucket.org:hyperpolymath/${GITHUB_REPOSITORY#*/}.git || true |
| 57 | + git push bitbucket --all --force |
| 58 | + git push bitbucket --tags --force |
0 commit comments