From 9f14c74b3e8e80eea5701dde644333fd0150b0d1 Mon Sep 17 00:00:00 2001 From: Kpa-clawbot Date: Wed, 1 Apr 2026 22:27:12 -0700 Subject: [PATCH] ci: add Docker cleanup before build to prevent disk space exhaustion (#473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fixes #472 The Docker build job on the self-hosted runner fails with `no space left on device` because Docker build cache and Go module downloads accumulate between runs. The existing cleanup (line ~330) runs in the **deploy** step *after* the build — too late to help. ## Changes - Added a "Free disk space" step at the start of the build job, **before** "Build Go Docker image": - `docker system prune -af` — removes all unused images, containers, networks - `docker builder prune -af` — clears the build cache - `df -h /` — logs available disk space for visibility - Kept the existing post-deploy cleanup as belt-and-suspenders --------- Co-authored-by: you Co-authored-by: Kpa-clawbot --- .github/workflows/deploy.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1cfffff7..e1d905f5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -246,6 +246,12 @@ jobs: with: node-version: '22' + - name: Free disk space + run: | + docker system prune -af 2>/dev/null || true + docker builder prune -af 2>/dev/null || true + df -h / + - name: Build Go Docker image run: | echo "${GITHUB_SHA::7}" > .git-commit