Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ jobs:
needs: [changes, docker]
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 15
strategy:
fail-fast: false
# Avoid a burst of registry requests when all image builds finish.
max-parallel: 1
matrix: ${{ fromJSON(needs.changes.outputs.matrix) }}
steps:
- name: Compute image tag
Expand Down Expand Up @@ -164,8 +166,27 @@ jobs:
arm64=$(cat "$RUNNER_TEMP/digests/arm64.txt")
test -n "$amd64"
test -n "$arm64"
docker buildx imagetools create --tag "poldixd/php:$TAG" \
"poldixd/php@$amd64" "poldixd/php@$arm64"
attempt=1
delay=30
while true; do
if output=$(docker buildx imagetools create --tag "poldixd/php:$TAG" \
"poldixd/php@$amd64" "poldixd/php@$arm64" 2>&1); then
printf '%s\n' "$output"
break
else
status=$?
printf '%s\n' "$output" >&2
fi
# Retry rate limits; surface authentication or manifest errors immediately.
if ! printf '%s\n' "$output" | grep -Eiq 'too many requests|toomanyrequests' ||
[ "$attempt" -ge 5 ]; then
exit "$status"
fi
echo "::warning::Docker Hub rate limited publishing $TAG (attempt $attempt/5); retrying in ${delay}s."
sleep "$delay"
attempt=$((attempt + 1))
delay=$((delay * 2))
done

checks:
name: Image checks
Expand Down