Add mirror sync workflow file

This commit is contained in:
DaStra3003
2026-10-01 10:09:12 +02:00
parent 3de8ded7c2
commit 3287e515d5
+28
View File
@@ -0,0 +1,28 @@
# Löst nach jedem Push sofort die Synchronisation des Gitea/Forgejo-Mirrors aus.
# Ablage im Repo: .github/workflows/mirror-sync.yml
name: Gitea Mirror Sync
on:
push: # neue Commits auf beliebigen Branches und neue Tags
delete: # gelöschte Branches/Tags ebenfalls übernehmen
workflow_dispatch: # manuell auslösbar (zum Testen)
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Mirror-Sync auf Gitea/Forgejo anstoßen
env:
GITEA_URL: ${{ secrets.GITEA_URL }} # z. B. https://git.example.com (ohne / am Ende)
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} # Token mit Schreibrecht auf das Mirror-Repo
GITEA_OWNER: ${{ vars.GITEA_OWNER }} # Besitzer/Organisation des Mirrors
GITEA_REPO: ${{ vars.GITEA_REPO }} # Name des Mirror-Repos
run: |
curl --fail-with-body --silent --show-error \
--retry 3 --retry-delay 5 \
-X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
"${GITEA_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/mirror-sync"
echo "Mirror-Sync angestoßen."