Pull blueprints at build time; drop the live branch deploy path - #5694
Draft
ZJvandeWeg wants to merge 2 commits into
Draft
Pull blueprints at build time; drop the live branch deploy path#5694ZJvandeWeg wants to merge 2 commits into
ZJvandeWeg wants to merge 2 commits into
Conversation
Blueprints were previously fetched by the "Build Site" Actions workflow, committed onto a force-pushed `live` branch, which Netlify watched for production deploys. Product docs already resolve at build time via nuxt/lib/docs-sync.mjs; this applies the same pattern to blueprints so Netlify can build straight from `main`. - nuxt/lib/blueprints-sync.mjs: resolves FlowFuse/blueprint-library the same way docs-sync.mjs resolves flowfuse/flowfuse (local -> sibling -> clone), writing into src/blueprints. blueprint-library is private, so the clone step authenticates with a GitHub App installation token (nuxt/lib/github-app-token.mjs, via @octokit/auth-app) minted from the existing GH_BOT_APP_ID/GH_BOT_APP_KEY credentials, rather than cloning anonymously like docs does. - scripts/copy_blueprints.mjs replaces scripts/copy_blueprints.js as a thin CLI entry point (ESM, mirrors scripts/sync_docs.mjs). - .github/workflows/build.yml: dropped the blueprint-library checkout/commit/force-push-to-live steps. Kept as a thin trigger that hits a Netlify build hook, since flowfuse/flowfuse's "Publish Documentation" workflow dispatches this workflow by name after a docs PR merges, and it also covers blueprint-library changes on a schedule (neither pushes to this repo, so Netlify wouldn't otherwise notice). This PR only contains the code side. Manual Netlify/GitHub setup is still required before the live branch can be retired - see the PR description.
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
CI's build_website.yml checks out blueprint-library as a sibling and calls `npm run blueprints` before `npm install` (same reason docs-sync.mjs stays dependency-free). A static import of github-app-token.mjs pulled in @octokit/auth-app at module-load time regardless of which resolveSource() branch actually ran, crashing a build that only ever takes the sibling path and never touches the clone/token code at all. Load it lazily inside cloneBlueprints() instead, so it's only required when the clone path is actually reached - which only happens on Netlify, where npm install has already completed by the time the build command runs.
ZJvandeWeg
marked this pull request as draft
August 27, 2026 22:45
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.

Summary
Blueprints were previously fetched by the
Build SiteActions workflow, committed onto a force-pushedlivebranch, and Netlify watched that branch for production deploys. Product docs already resolve at build time (nuxt/lib/docs-sync.mjs); this applies the same pattern to blueprints so Netlify can build straight frommain, and thelivebranch can go away.This ships as two logical steps:
nuxt/lib/blueprints-sync.mjsresolvesFlowFuse/blueprint-librarythe same local → sibling → clone precedence as docs, writing intosrc/blueprints.blueprint-libraryis private (unlike the publicflowfuse/flowfusedocs source), so the clone step authenticates with a GitHub App installation token (nuxt/lib/github-app-token.mjs, via@octokit/auth-app) minted from the existingGH_BOT_APP_ID/GH_BOT_APP_KEYcredentials, instead of cloning anonymously.livebranch requirement..github/workflows/build.ymlno longer checks outblueprint-library, commits, or force-pushes tolive— it's now a thin trigger that hits a Netlify build hook. It's kept (not deleted) becauseflowfuse/flowfuse'sPublish Documentationworkflow dispatches it by name after a docs PR merges to trigger a website rebuild, and it also runs on the existing cron schedule to pick upblueprint-librarychanges — neither of those pushes anything to this repo, so Netlify wouldn't otherwise notice.Manual setup required before
livecan be retiredThis PR is the code side only. None of it takes effect in production until the following is done, in order:
GH_BOT_APP_IDandGH_BOT_APP_KEY— same values as the existing GitHub Actions secrets of the same name. This is what lets Netlify's build clone the privateblueprint-libraryrepo.NETLIFY_BUILD_HOOKsecret in this GitHub repolivetomainin site settings. Post-merge this ismainactually renders blueprints correctly (image paths,flow.jsonpassthrough, etc.) before relying on it.livebranch once step 4 is confirmed working.GH_BOT_APP_ID/GH_BOT_APP_KEYare a shared org-wide GitHub App credential also used byproject-automation.ymlin this repo and byflowfuse/flowfuse'sdocs.yml— adding them as a Netlify env var is read-only reuse, it doesn't move or affect those existing usages.Test plan
npm test— all 111 tests passnpm run blueprintslocally against the real../blueprint-librarysibling checkout — verifiedimage:frontmatter paths, README→index renaming, andflow.jsonpassthrough all match the previous script's outputmain(with the clone-fallback path, not the sibling path) verified to produce working blueprint pages