Extract the site build into a reusable workflow - #5515
Open
dimitrieh wants to merge 3 commits into
Open
Conversation
test.yml and FlowFuse/flowfuse's docs.yml both carried their own copy of the same pipeline: app token, website and blueprint-library checkouts, Node 24, blueprints, install, build, hyperlink. Two copies of one build, already drifting, and the flowfuse copy threw its output away after the link check. site-preview.yml is now the single definition, called from both sides. The flowfuse caller passes its PR as docs_repository/docs_ref, which lands the checkout next to the website so docs-sync.mjs prefers it over cloning main, and sets deploy_preview so the build is uploaded to Netlify under a per-PR alias instead of being discarded. Two behaviour notes: - Previews build with `build:nuxt` rather than `build:nuxt:skip-images`, because nuxt.config.ts drops the image provider to none when SKIP_IMAGES is set. This matches netlify.toml's deploy-preview context. - The image cache key was static, so the entry was written once and never refreshed, and it pointed at the Eleventy-era `_site/img`. It is now a rolling key over the two directories netlify.toml's cache plugin keeps warm. The upload never passes --prod and never passes --build, so netlify.toml's build command (which reindexes Algolia) does not run against a preview, and a step fails the job if Netlify hands back the production URL. test_website is kept as a gate job because a reusable workflow reports its checks as "caller job / called job", which would rename the context the "protect main" ruleset requires.
… absent A caller that sets deploy_preview without passing the token or site id would otherwise get an opaque netlify-cli error.
2 tasks
Contributor
Author
Contributor
Author
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
@dimitrieh Could you elaborate on the skip-images point? The way it's worked so far is just skipping image optimization, images are still "real" and visible either way. The reason we skip it is that it takes longer than necessary for a preview, and with Netlify's recent issue where it drops the cache for no reason, we were getting ~90min builds on random production deploys too, so it's currently disabled for production as well. |
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.

Description
test.ymland FlowFuse/flowfuse'sdocs.ymleach carried their own copy of the same build: app token, website and blueprint-library checkouts, Node 24, blueprints, install, build, hyperlink.site-preview.ymlis now the single definition, called from both, so changes to the build or the deploy here are picked up on the flowfuse side automatically as the Nuxt migration progresses. It also gains an optional Netlify upload, which is what gives documentation PRs a preview URL.Two behaviour changes worth a look: a preview builds with
build:nuxtinstead ofbuild:nuxt:skip-images, becausenuxt.config.tsdrops the image provider to none whenSKIP_IMAGESis set; and the image cache key is now rolling and points atnuxt/public/imgplus.cache/imagesrather than the Eleventy-era_site/img, which was written once and never refreshed.test_websiteis kept as a gate job so the context name the "protect main" ruleset requires does not change.Merge this before the caller. The caller side is FlowFuse/flowfuse#8070, which tracks this branch until this PR lands and then moves to
@main.Related Issue(s)
Caller side: FlowFuse/flowfuse#8070
Checklist