fix: overwrite existing git tag on deploy retry
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m49s
CI / E2E browser tests (push) Successful in 46s

The deploy workflow failed when re-running with the same version tag
because Git rejects pushing a tag that already exists on the remote.

- Delete local tag first (ignore if missing)
- Delete remote tag first (ignore if missing)
- Create and push the tag fresh

This makes deploys idempotent: retrying a failed deploy with the same
version (e.g., v0.1.0) will succeed by moving the tag to the current
commit. For a new deploy, the delete commands silently do nothing.
This commit is contained in:
Joakim Mörling 2026-05-20 12:28:16 +02:00
parent 5eb49c05a8
commit d078b9e125

View file

@ -22,6 +22,8 @@ jobs:
- name: Tag version
run: |
git tag -d ${{ github.event.inputs.version }} 2>/dev/null || true
git push origin --delete ${{ github.event.inputs.version }} 2>/dev/null || true
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}