ci(docker_image.yml): workaround for sometimes unstable ghcr.io

ghcr.io sometimes drops connection when image is pushed from GitHub
Actions. I never observed that behavior when pushing the image built
locally, so don't know what triggers that issue.

The workaround is to just try pushing the image again.
This commit is contained in:
Leonid Pliushch 2022-07-23 11:32:57 +03:00
parent 28690abbbd
commit 47e6537bb2
No known key found for this signature in database
GPG Key ID: 268047C7D92B9FF0
1 changed files with 13 additions and 1 deletions

View File

@ -43,5 +43,17 @@ jobs:
- name: Push
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'termux/termux-packages'
run: |
docker push ghcr.io/termux/package-builder:latest
# ghcr.io seem to be unstable sometimes. It may suddenly drop connection
# during docker push when some layers are already uploaded. The workaround
# is to retry again 1 or 2 more times.
for t in 1 2 3; do
if docker push "ghcr.io/termux/package-builder:latest"; then
break
else
if [ "$t" = "3" ]; then
exit 1
fi
fi
done
docker push termux/package-builder:latest