Ensure contentlayer generated during image build

This commit is contained in:
cloudneutral 2025-12-23 13:26:11 +08:00
parent 122b82a5ab
commit b432026c11
2 changed files with 3 additions and 0 deletions

View File

@ -127,6 +127,7 @@ jobs:
GO_RUNTIME_IMAGE=${{ env.GO_RUNTIME_IMAGE }}
NODE_BUILDER_IMAGE=${{ env.NODE_BUILDER_IMAGE }}
NODE_RUNTIME_IMAGE=${{ env.NODE_RUNTIME_IMAGE }}
CONTENTLAYER_BUILD=true
# -------------------------------------------------------------
# Validate runtime mount for blog content

View File

@ -3,6 +3,7 @@
# =======================================================
ARG NODE_BUILDER_IMAGE=node:22-bookworm
ARG NODE_RUNTIME_IMAGE=node:22-slim
ARG CONTENTLAYER_BUILD=true
# -------------------------------------------------------
# Stage 1 — Builder (Turbopack + standalone)
@ -29,6 +30,7 @@ RUN rm -rf src/content/blog/* \
&& mkdir -p src/content/blog
RUN find . -name "package-lock.json" -delete
RUN yarn install --immutable
RUN if [ "$CONTENTLAYER_BUILD" = "true" ]; then yarn contentlayer build; fi
RUN yarn next build
# -------------------------------------------------------