From 6c46ca98a703f701c64ae35b5253a584b6cb9c2e Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 23 May 2026 13:43:07 +0200 Subject: [PATCH] ci: switch buildx cache-to to mode=min MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mode=max was re-uploading the bun install cache mount (~40–60s per build, ~90s combined for api-core + web) to the Gitea OCI registry on every push, even when source hadn't changed. That single export accounts for most of the delta between 1-minute and 3-minute deploys. mode=min only exports the final stage's layers. The trade-off is a few-second tax on cold buildkitd starts (the installer stage no longer warms from registry cache), but the per-push savings dwarf it. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build-deploy-game.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build-deploy-game.yml b/.gitea/workflows/build-deploy-game.yml index 5e7d0bd..15a86da 100644 --- a/.gitea/workflows/build-deploy-game.yml +++ b/.gitea/workflows/build-deploy-game.yml @@ -80,8 +80,15 @@ jobs: npmrc=/tmp/.npmrc cache-from: | type=registry,ref=git.unom.io/${{ gitea.repository }}/api-core:cache + # mode=min: export only the final stage's layers. mode=max + # was re-uploading the bun-install cache mount (~40–60s) to + # the Gitea OCI registry on every push, even no-op deploys. + # Trade-off: a cold buildkitd will re-run `bun install` from + # scratch on the installer stage instead of importing it + # from registry cache — a few-second tax in exchange for + # not paying the export tax on every run. cache-to: | - type=registry,ref=git.unom.io/${{ gitea.repository }}/api-core:cache,mode=max + type=registry,ref=git.unom.io/${{ gitea.repository }}/api-core:cache,mode=min deploy-api-core: runs-on: ubuntu-24.04 @@ -196,8 +203,9 @@ jobs: npmrc=/tmp/.npmrc cache-from: | type=registry,ref=git.unom.io/${{ gitea.repository }}/web:cache + # See the api-core cache-to block above for the mode=min rationale. cache-to: | - type=registry,ref=git.unom.io/${{ gitea.repository }}/web:cache,mode=max + type=registry,ref=git.unom.io/${{ gitea.repository }}/web:cache,mode=min deploy-web: runs-on: ubuntu-24.04