From b5244b7f518cc3d029485713ca3805fe692d8643 Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:59:41 -0400 Subject: [PATCH] fix(docker): reference FRONTEND_CACHE_BUST so the frontend clone actually busts cache The Dockerfile declared FRONTEND_CACHE_BUST but never referenced it, so BuildKit kept the 'git clone --branch main' layer cached across builds and baked a stale frontend. Reference the arg in the clone RUN so a changed value forces a fresh clone, and pass FRONTEND_CACHE_BUST in release.yml's docker build (ci.yml already passes it). --- .github/workflows/release.yml | 1 + Dockerfile | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cf11de..acdfd01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,3 +99,4 @@ jobs: build-args: | GIT_SHA=${{ steps.sha.outputs.short }} BUILD_DATE=${{ github.event.head_commit.timestamp }} + FRONTEND_CACHE_BUST=${{ github.run_id }} diff --git a/Dockerfile b/Dockerfile index 7b6ef75..ed7677f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,11 @@ ARG FRONTEND_REF=main ARG FRONTEND_CACHE_BUST="" WORKDIR /frontend -RUN git clone --depth 1 --branch "$FRONTEND_REF" "$FRONTEND_REPO" . +# Reference FRONTEND_CACHE_BUST so a changed value invalidates this layer's cache +# and forces a fresh clone of the frontend on each build (BuildKit only busts a +# layer when the RUN references the arg). +RUN echo "cache-bust: $FRONTEND_CACHE_BUST" && \ + git clone --depth 1 --branch "$FRONTEND_REF" "$FRONTEND_REPO" . # Install dependencies RUN pnpm install --frozen-lockfile