fix(publish): free runner disk before build and retry docker push

Auto-tracking the newest Godot/Blender means most nightly runs now
build genuinely new multi-GB layers instead of hitting cache, and
nothing ever pruned old ones — the runner's disk fills up over
successive runs until a push fails. Prune before building, and retry
docker push a few times to ride out transient registry 500s.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 22:03:06 +02:00
co-authored by Claude-Bot
parent 1e283fd77f
commit 5ef5fce4a4
+26 -2
View File
@@ -65,6 +65,15 @@ jobs:
id: blender
run: echo "url=$(./scripts/resolve-blender-url.sh)" >> "$GITHUB_OUTPUT"
# Now that this workflow tracks the newest Godot/Blender instead of one
# pinned version, most nightly runs build genuinely new multi-GB layers
# instead of hitting cache — nothing here ever pruned old ones, so the
# runner's disk fills up over successive runs until a push (a blob
# write) is what finally fails. Clear stale images/build cache first.
- name: Free up runner disk
if: steps.resolve.outputs.skip != 'true'
run: docker system prune -af --volumes
- name: Build and push
if: steps.resolve.outputs.skip != 'true'
run: |
@@ -74,11 +83,26 @@ jobs:
--build-arg GODOT_VERSION="$VERSION" \
--build-arg BLENDER_URL="${{ steps.blender.outputs.url }}" \
-t "${IMAGE}:${VERSION}" .
docker push "${IMAGE}:${VERSION}"
# Registry blob PUTs have been failing with transient 500s
# (unrelated to build correctness) — retry a few times before
# giving up.
push_with_retry() {
for attempt in 1 2 3; do
if docker push "$1"; then
return 0
fi
echo "::warning::docker push $1 failed (attempt $attempt/3), retrying..."
sleep $((attempt * 10))
done
return 1
}
push_with_retry "${IMAGE}:${VERSION}"
if [ "${{ steps.resolve.outputs.update_latest }}" = "true" ]; then
docker tag "${IMAGE}:${VERSION}" "${IMAGE}:latest"
docker push "${IMAGE}:latest"
push_with_retry "${IMAGE}:latest"
fi
# Gitea packages belong to the owner, not a repo, by default — pushing