ci: retry registry login, pull and push
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 1m48s

A transient timeout on the registry token endpoint failed the publication of
v0.7.2-evogo.2 (run 482) after the image had already been built and scanned.
Login, pull and push now retry up to 5 times with linear backoff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
jfengandClaude Opus 5.5 committed 2026-11-11 07:52:15 -03:00
1 parent 5b71495e93
commit c9511a636e
3 files changed
+35 -6

No files matched your search

+16 -3
View File
@@ -47,12 +47,25 @@ jobs:
[ -n "$USER" ] || USER="${{ github.actor }}"
TOKEN="${{ secrets.REGISTRY_TOKEN }}"
[ -n "$TOKEN" ] || TOKEN="${{ secrets.GITEA_TOKEN }}"
echo "$TOKEN" | docker login "$REGISTRY" -u "$USER" --password-stdin
for n in 1 2 3 4 5; do
echo "$TOKEN" | docker login "$REGISTRY" -u "$USER" --password-stdin && exit 0
echo "Login falhou (tentativa $n/5); nova tentativa em $((n*15))s"
sleep $((n*15))
done
exit 1
- name: Re-etiquetar como latest
run: |
retry() {
for n in 1 2 3 4 5; do
"$@" && return 0
echo "'$*' falhou (tentativa $n/5); nova tentativa em $((n*15))s"
sleep $((n*15))
done
return 1
}
SRC="${{ steps.rel.outputs.source }}"
docker pull "$SRC"
retry docker pull "$SRC"
docker tag "$SRC" "$IMAGE:latest"
docker push "$IMAGE:latest"
retry docker push "$IMAGE:latest"
echo "Publicado: $IMAGE:latest (mesmo digest de $SRC)"