Skip to content

Commit f29714f

Browse files
committed
CI/CD: Added mirror workflow to codeberg
1 parent 7d24f3a commit f29714f

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/mirror.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Mirror
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
9+
mirror-codeberg:
10+
name: Mirror to Codeberg.org
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup SSH
19+
shell: bash
20+
env:
21+
CODEBERG_SSH_KEY: ${{ secrets.CODEBERG_SSH_KEY }}
22+
CODEBERG_SSH_FINGERPRINT: ${{ vars.CODEBERG_SSH_FINGERPRINT }}
23+
run: |
24+
mkdir ~/.ssh
25+
chmod 0744 ~/.ssh
26+
echo "$CODEBERG_SSH_KEY" > ~/.ssh/id_codeberg
27+
echo "$CODEBERG_SSH_FINGERPRINT" >> ~/.ssh/known_hosts
28+
chmod 0600 ~/.ssh/id_codeberg
29+
chmod 0600 ~/.ssh/known_hosts
30+
31+
- name: Mirror
32+
shell: bash
33+
run: |
34+
export GIT_SSH_COMMAND="ssh -i ~/.ssh/id_codeberg -o IdentitiesOnly=yes"
35+
git remote add codeberg ssh://git@codeberg.org/portablemc/portablemc.git
36+
git push --force --mirror codeberg

0 commit comments

Comments
 (0)