From e367961dd103735ef6511269b45342126e74f2db Mon Sep 17 00:00:00 2001 From: Jory Irving Date: Wed, 1 Jul 2026 21:10:32 -0600 Subject: [PATCH] ci(image): stop exporting build cache from PR builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mode=max cache export re-uploads every stage's layers (~1GB of node_modules trees) to the GHA cache backend whenever package.json changes — ~270s of every release-bump and Renovate PR build (72% of the 405s worst case). PRs now only consume the cache; main and tag builds keep it warm. --- .github/workflows/image.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 0b4d8ccf..50a5ca41 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -67,7 +67,11 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max + # Only main/tag builds write the cache. PR builds read it but never + # export — the mode=max export re-uploads every stage's layers + # (~1GB of node_modules) whenever package.json changes, which was + # ~270s of every release-bump and Renovate PR build. + cache-to: ${{ github.event_name != 'pull_request' && 'type=gha,mode=max' || '' }} build-args: | DATABASE_URL=postgresql://localhost:5432/dispatch