From 262bd8b01cc7c14ea252e6de9ed6881a17c653d6 Mon Sep 17 00:00:00 2001 From: Sir Blob <76974209+SirBlobby@users.noreply.github.com> Date: Fri, 7 Nov 2025 17:57:42 -0500 Subject: [PATCH] Add workflow to sync repository to Gitea --- .github/workflows/sync-to-gitea.yml | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/sync-to-gitea.yml diff --git a/.github/workflows/sync-to-gitea.yml b/.github/workflows/sync-to-gitea.yml new file mode 100644 index 0000000..64e9622 --- /dev/null +++ b/.github/workflows/sync-to-gitea.yml @@ -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"