Browse Source

ci: add workflow to mirror Git repo to Codeberg

Frédéric Guillot 4 months ago
parent
commit
0960624e85
1 changed files with 26 additions and 0 deletions
  1. 26 0
      .github/workflows/codeberg_mirror.yml

+ 26 - 0
.github/workflows/codeberg_mirror.yml

@@ -0,0 +1,26 @@
+name: Mirror to Codeberg
+
+on:
+  push:
+    branches: [ main ]
+  delete:
+  create:
+  workflow_dispatch:
+
+jobs:
+  mirror:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+      - name: Mirror to Codeberg
+        env:
+          CODEBERG_USERNAME: ${{ secrets.CODEBERG_USERNAME }}
+          CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
+        run: |
+          git remote add codeberg https://${{ secrets.CODEBERG_USERNAME }}:${{ secrets.CODEBERG_TOKEN }}@codeberg.org/miniflux/v2.git
+          git push --force --prune codeberg \
+            "refs/heads/*:refs/heads/*" \
+            "refs/tags/*:refs/tags/*"