fix(ci): always use full production build in CI workflows#7510
Merged
leecalcote merged 3 commits intomasterfrom Mar 13, 2026
Merged
fix(ci): always use full production build in CI workflows#7510leecalcote merged 3 commits intomasterfrom
leecalcote merged 3 commits intomasterfrom
Conversation
… full site build The deploy and preview CI workflows were calling `make clean`, a developer convenience Makefile target whose recipe has changed several times: - Previously ran `gatsby clean && make site` which launched `gatsby develop:lite` (a lite/dev build that EXCLUDES blog, news, events, and resources collections) or failed with "gatsby: not found" because gatsby is not globally installed in CI. - Was later patched to `npm run clean && make build`, but this dependency on a mutable Makefile target is fragile and has already caused multiple production outages where blog posts (and other collections) were missing from the site. Fix: call `npm run build` directly in both workflow files. `npm run build` is defined in package.json as: cross-env BUILD_FULL_SITE=true gatsby build This is the canonical, stable production build command and always includes all collections. It cannot be accidentally changed to a lite build. Also clarifies the Makefile `clean` target comment to note it is for local developer use only; CI should not rely on it.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates CI workflows to always run the canonical full production Gatsby build (npm run build) instead of relying on the mutable make clean target, preventing accidental “lite/dev” builds and missing collections in deployed output.
Changes:
- Replaces
make cleanwithnpm run buildin preview and deploy GitHub Actions workflows. - Splits “Install and Build” into separate install/build steps and documents why.
- Adds a Makefile comment clarifying
cleanis developer-only and CI should callnpm run build.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Makefile |
Clarifies intent of the clean target to discourage CI usage. |
.github/workflows/build-and-preview-site.yml |
Runs npm run build explicitly for full production build in preview workflow. |
.github/workflows/build-and-deploy-site.yml |
Runs npm run build explicitly for full production build in deploy workflow. |
|
|
||
| ## Empty build cache and run layer5.io on your local machine. | ||
| clean: | ||
| ## Empty build cache and rebuild layer5.io on your local machine (developer use only; CI uses `npm run build` directly). |
Comment on lines
+21
to
+27
| # Always run the full production build explicitly. | ||
| # Do NOT use `make clean` here — that target is a developer convenience | ||
| # command whose recipe has changed multiple times, causing blog posts and | ||
| # other collections to be silently excluded from the deployed site when | ||
| # it ran a lite/dev build instead of the full production build. | ||
| # `npm run build` is the canonical, stable production build command: | ||
| # cross-env BUILD_FULL_SITE=true gatsby build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
The
build-and-deploy-site.ymlandbuild-and-preview-site.ymlworkflows were callingmake clean. ThecleanMakefile target is a developer convenience command whose recipe has changed multiple times, each time breaking production:make cleanrangatsby clean && make site→gatsby develop:lite22c47cf3a)gatsby cleanfailed with/bin/sh: gatsby: not foundnpm run clean && make buildEvery time
make cleanwas changed for local dev ergonomics, it silently broke CI.Fix
Call
npm run builddirectly in both workflow files. This script is defined inpackage.jsonas:It is the canonical, stable production build command that:
BUILD_FULL_SITE=trueso all collections are included (blog, news, events, resources, members, integrations)Also adds a comment to the Makefile
cleantarget to mark it as developer-only, preventing future confusion about using it in CI.Test plan
mastertriggers a full production build (1298 pages, 108+ blog pages) rather than a lite build/blogshows all published posts including 2024 and 2025 entries after deployment/resourcesstill works as expected