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