Sync Workflow
Some checks failed
Sync to GitHub / sync (push) Failing after 1m5s
Build and Release / Build Linux (push) Has been skipped
Build and Release / Build Windows (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:
2025-11-07 18:11:03 -05:00
parent 262bd8b01c
commit d52bd8c31b

52
.gitea/workflows/sync.yml Normal file
View File

@@ -0,0 +1,52 @@
name: Sync to GitHub
on:
push:
branches:
- '**' # Sync all branches
delete:
branches:
- '**' # Sync branch deletions
create:
tags:
- '**' # Sync tag creation
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 "Gitea Actions"
git config --global user.email "actions@gitea.local"
- name: Add GitHub remote
run: |
git remote add github https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN }}@github.com/${{ secrets.GH_REPO }}
- name: Fetch all branches and tags
run: |
git fetch --all
git fetch --tags
- name: Push to GitHub (mirror)
run: |
git push github --mirror --force
- name: Sync status
if: success()
run: |
echo "✅ Successfully synced to GitHub!"
echo "Repository: github.com/${{ secrets.GH_REPO }}"
- name: Sync failed
if: failure()
run: |
echo "❌ Failed to sync to GitHub"
echo "Check your GitHub credentials and repository path"