|
1 | 1 | # SPDX-License-Identifier: MPL-2.0 |
2 | | -# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell |
3 | 2 | name: Mirror to Git Forges |
4 | 3 |
|
5 | 4 | on: |
6 | 5 | push: |
7 | 6 | branches: [main] |
8 | 7 | workflow_dispatch: |
9 | 8 |
|
10 | | -# Cause-B mitigation (#77): de-duplicate stacked mirror runs. |
11 | | -# cancel-in-progress is false so an in-flight mirror push always |
12 | | -# completes (a half-cancelled mirror could leave the remote stale). |
13 | | -concurrency: |
14 | | - group: ${{ github.workflow }}-${{ github.ref }} |
15 | | - cancel-in-progress: false |
16 | | - |
17 | 9 | permissions: |
18 | 10 | contents: read |
19 | 11 |
|
20 | 12 | jobs: |
21 | | - mirror-gitlab: |
22 | | - runs-on: ubuntu-latest |
23 | | - if: vars.GITLAB_MIRROR_ENABLED == 'true' |
24 | | - steps: |
25 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
26 | | - with: |
27 | | - fetch-depth: 0 |
28 | | - |
29 | | - - uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0 |
30 | | - with: |
31 | | - ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }} |
32 | | - |
33 | | - - name: Mirror to GitLab |
34 | | - run: | |
35 | | - ssh-keyscan -t ed25519 gitlab.com >> ~/.ssh/known_hosts |
36 | | - git remote add gitlab git@gitlab.com:hyperpolymath/${{ github.event.repository.name }}.git || true |
37 | | - git push --force gitlab main |
38 | | -
|
39 | | - mirror-bitbucket: |
40 | | - runs-on: ubuntu-latest |
41 | | - if: vars.BITBUCKET_MIRROR_ENABLED == 'true' |
42 | | - steps: |
43 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
44 | | - with: |
45 | | - fetch-depth: 0 |
46 | | - |
47 | | - - uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0 |
48 | | - with: |
49 | | - ssh-private-key: ${{ secrets.BITBUCKET_SSH_KEY }} |
50 | | - |
51 | | - - name: Mirror to Bitbucket |
52 | | - run: | |
53 | | - ssh-keyscan -t ed25519 bitbucket.org >> ~/.ssh/known_hosts |
54 | | - git remote add bitbucket git@bitbucket.org:hyperpolymath/${{ github.event.repository.name }}.git || true |
55 | | - git push --force bitbucket main |
56 | | -
|
57 | | - mirror-codeberg: |
58 | | - runs-on: ubuntu-latest |
59 | | - if: vars.CODEBERG_MIRROR_ENABLED == 'true' |
60 | | - steps: |
61 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
62 | | - with: |
63 | | - fetch-depth: 0 |
64 | | - |
65 | | - - uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0 |
66 | | - with: |
67 | | - ssh-private-key: ${{ secrets.CODEBERG_SSH_KEY }} |
68 | | - |
69 | | - - name: Mirror to Codeberg |
70 | | - run: | |
71 | | - ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts |
72 | | - git remote add codeberg git@codeberg.org:hyperpolymath/${{ github.event.repository.name }}.git || true |
73 | | - git push --force codeberg main |
74 | | -
|
75 | | - mirror-sourcehut: |
76 | | - runs-on: ubuntu-latest |
77 | | - if: vars.SOURCEHUT_MIRROR_ENABLED == 'true' |
78 | | - steps: |
79 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
80 | | - with: |
81 | | - fetch-depth: 0 |
82 | | - |
83 | | - - uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0 |
84 | | - with: |
85 | | - ssh-private-key: ${{ secrets.SOURCEHUT_SSH_KEY }} |
86 | | - |
87 | | - - name: Mirror to SourceHut |
88 | | - run: | |
89 | | - ssh-keyscan -t ed25519 git.sr.ht >> ~/.ssh/known_hosts |
90 | | - git remote add sourcehut git@git.sr.ht:~hyperpolymath/${{ github.event.repository.name }} || true |
91 | | - git push --force sourcehut main |
92 | | -
|
93 | | - mirror-disroot: |
94 | | - runs-on: ubuntu-latest |
95 | | - if: vars.DISROOT_MIRROR_ENABLED == 'true' |
96 | | - steps: |
97 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
98 | | - with: |
99 | | - fetch-depth: 0 |
100 | | - |
101 | | - - uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0 |
102 | | - with: |
103 | | - ssh-private-key: ${{ secrets.DISROOT_SSH_KEY }} |
104 | | - |
105 | | - - name: Mirror to Disroot |
106 | | - run: | |
107 | | - ssh-keyscan -t ed25519 git.disroot.org >> ~/.ssh/known_hosts |
108 | | - git remote add disroot git@git.disroot.org:hyperpolymath/${{ github.event.repository.name }}.git || true |
109 | | - git push --force disroot main |
110 | | -
|
111 | | - mirror-gitea: |
112 | | - runs-on: ubuntu-latest |
113 | | - if: vars.GITEA_MIRROR_ENABLED == 'true' |
114 | | - steps: |
115 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
116 | | - with: |
117 | | - fetch-depth: 0 |
118 | | - |
119 | | - - uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0 |
120 | | - with: |
121 | | - ssh-private-key: ${{ secrets.GITEA_SSH_KEY }} |
122 | | - |
123 | | - - name: Mirror to Gitea |
124 | | - run: | |
125 | | - ssh-keyscan -t ed25519 ${{ vars.GITEA_HOST }} >> ~/.ssh/known_hosts |
126 | | - git remote add gitea git@${{ vars.GITEA_HOST }}:hyperpolymath/${{ github.event.repository.name }}.git || true |
127 | | - git push --force gitea main |
128 | | -
|
129 | | - mirror-radicle: |
130 | | - runs-on: ubuntu-latest |
131 | | - if: vars.RADICLE_MIRROR_ENABLED == 'true' |
132 | | - steps: |
133 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 |
134 | | - with: |
135 | | - fetch-depth: 0 |
136 | | - |
137 | | - - name: Install Radicle |
138 | | - run: | |
139 | | - curl -sSf https://radicle.xyz/install | sh |
140 | | - echo "$HOME/.radicle/bin" >> $GITHUB_PATH |
141 | | -
|
142 | | - - name: Mirror to Radicle |
143 | | - run: | |
144 | | - echo "${{ secrets.RADICLE_KEY }}" > ~/.radicle/keys/radicle |
145 | | - chmod 600 ~/.radicle/keys/radicle |
146 | | - rad sync --announce || echo "Radicle sync attempted" |
| 13 | + mirror: |
| 14 | + uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@e6b2884722350515934d443daf23442f2195796f |
| 15 | + secrets: inherit |
0 commit comments