mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
fix docker build harder
This commit is contained in:
29
.github/workflows/docker.yml
vendored
29
.github/workflows/docker.yml
vendored
@@ -43,24 +43,11 @@ jobs:
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Build and push Docker image with cache & retry
|
||||
run: |
|
||||
set -e
|
||||
for i in {1..3}; do
|
||||
echo "Attempt $i of 3"
|
||||
docker buildx build \
|
||||
--push \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--tag ${{ steps.meta.outputs.tags }} \
|
||||
--label ${{ steps.meta.outputs.labels }} \
|
||||
--cache-from=type=gha \
|
||||
--cache-to=type=gha,mode=max \
|
||||
. && break || echo "Build failed (attempt $i)"
|
||||
if [ $i -eq 3 ]; then
|
||||
echo "Docker build failed after 3 attempts. Exiting with error."
|
||||
exit 1
|
||||
else
|
||||
echo "Retrying in 10 seconds..."
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
Reference in New Issue
Block a user