Add workflow to sync repository to Gitea
Some checks failed
Build and Release / Build Windows (push) Has been cancelled
Build and Release / Build Linux (push) Has been cancelled
Build and Release / Build macOS (push) Has been cancelled
Build and Release / Create Release (push) Has been cancelled
Build and Release / Development Build (push) Has been cancelled

This commit is contained in:
Sir Blob
2025-11-07 17:57:42 -05:00
committed by GitHub
parent 74f8c78700
commit 262bd8b01c

55
.github/workflows/sync-to-gitea.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Sync to Gitea
on:
push:
branches:
- '**' # Sync all branches
delete:
branches:
- '**' # Sync branch deletions
create:
tags:
- '**' # Sync tag creation
workflow_dispatch: # Allow manual trigger
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
- name: Add Gitea remote
run: |
git remote add gitea https://${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_TOKEN }}@${{ secrets.GITEA_URL }}
- name: Fetch all branches and tags
run: |
git fetch --all
git fetch --tags
- name: Push to Gitea (mirror)
run: |
git push gitea --mirror --force
env:
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
- name: Sync status
if: success()
run: |
echo "✅ Successfully synced to Gitea!"
echo "Repository: ${{ secrets.GITEA_URL }}"
- name: Sync failed
if: failure()
run: |
echo "❌ Failed to sync to Gitea"
echo "Check your Gitea credentials and URL"