ci: fetch before push, use force-with-lease

This commit is contained in:
Tracewebstudio Dev 2026-04-19 15:59:58 +02:00
parent b3e2f5c173
commit bac43cfb2d

View file

@ -18,12 +18,16 @@ jobs:
- name: Push to Gitea high-performance
env:
GITEA_USERNAME: Admin
GITEA_TOKEN: ${{ secrets.GITEA_SECRET }}
run: |
echo "Syncing nxtgauge-admin-solid:main → Gitea high-performance"
set -euo pipefail
echo "Syncing ${{ github.event.repository.name }}:main → Gitea high-performance"
echo "Commit: $(git rev-parse HEAD)"
git remote add gitea "https://Admin:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/nxtgauge-admin-solid.git"
git push gitea main:high-performance --force-with-lease
git remote add gitea "https://${GITEA_USERNAME}:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/${{ github.event.repository.name }}.git"
git fetch gitea high-performance || true
git push gitea HEAD:high-performance --force-with-lease=refs/heads/high-performance
echo "Sync complete!"