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