Skip to content

Extract the site build into a reusable workflow - #5515

Open
dimitrieh wants to merge 3 commits into
mainfrom
docs-preview-shared-build
Open

Extract the site build into a reusable workflow#5515
dimitrieh wants to merge 3 commits into
mainfrom
docs-preview-shared-build

Conversation

@dimitrieh

@dimitrieh dimitrieh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

test.yml and FlowFuse/flowfuse's docs.yml each carried their own copy of the same build: app token, website and blueprint-library checkouts, Node 24, blueprints, install, build, hyperlink. site-preview.yml is 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:nuxt instead of build:nuxt:skip-images, because nuxt.config.ts drops the image provider to none when SKIP_IMAGES is set; and the image cache key is now rolling and points at nuxt/public/img plus .cache/images rather than the Eleventy-era _site/img, which was written once and never refreshed.

test_website is 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

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
  • For blog PRs, an Art Request has been created (instructions)

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.
@dimitrieh

Copy link
Copy Markdown
Contributor Author

@dimitrieh

Copy link
Copy Markdown
Contributor Author

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit ef292dd
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a731ef2965d4b000838d3e9
😎 Deploy Preview https://deploy-preview-5515--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 63 (🔴 down 4 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@Yndira-E

Yndira-E commented Aug 7, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants