diff --git a/.gitea/workflows/sync.yml b/.gitea/workflows/sync.yml new file mode 100644 index 0000000..ecbb312 --- /dev/null +++ b/.gitea/workflows/sync.yml @@ -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" \ No newline at end of file