ci: fetch before push, use force-with-lease
This commit is contained in:
parent
89d8d3be32
commit
8053cf5af7
1 changed files with 7 additions and 3 deletions
10
.github/workflows/sync-to-gitea.yml
vendored
10
.github/workflows/sync-to-gitea.yml
vendored
|
|
@ -18,12 +18,16 @@ jobs:
|
||||||
|
|
||||||
- name: Push to Gitea high-performance
|
- name: Push to Gitea high-performance
|
||||||
env:
|
env:
|
||||||
|
GITEA_USERNAME: Admin
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_SECRET }}
|
GITEA_TOKEN: ${{ secrets.GITEA_SECRET }}
|
||||||
run: |
|
run: |
|
||||||
echo "Syncing nxtgauge-frontend-solid:main → Gitea high-performance"
|
set -euo pipefail
|
||||||
|
echo "Syncing ${{ github.event.repository.name }}:main → Gitea high-performance"
|
||||||
echo "Commit: $(git rev-parse HEAD)"
|
echo "Commit: $(git rev-parse HEAD)"
|
||||||
|
|
||||||
git remote add gitea "https://Admin:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/nxtgauge-frontend-solid.git"
|
git remote add gitea "https://${GITEA_USERNAME}:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/${{ github.event.repository.name }}.git"
|
||||||
git push gitea main:high-performance --force-with-lease
|
|
||||||
|
git fetch gitea high-performance || true
|
||||||
|
git push gitea HEAD:high-performance --force-with-lease=refs/heads/high-performance
|
||||||
|
|
||||||
echo "Sync complete!"
|
echo "Sync complete!"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue