Preview the website on documentation pull requests - #8070
Conversation
test-with-website already checked out FlowFuse/website next to this repository and built the whole site with the pull request's docs, because docs-sync.mjs prefers a sibling checkout over cloning main. It then threw the output away after the link check. That build is now FlowFuse/website's site-preview.yml, called from here, so this repository stops carrying a second copy of the website pipeline and picks up changes to it as the Nuxt migration progresses. When the caller is a pull request from a branch in this repository it also uploads the result to Netlify under a docs-pr-<number> alias and reports the URL on the pull request. The upload is an aliased, unpublished deploy: no --prod, and no --build, so netlify.toml's build command (which reindexes Algolia) never runs against a preview and flowfuse.com keeps serving whatever it served before. test-with-website survives as a gate job so the check name and the publish dependency are unchanged.
Without this the pull request that changes docs.yml does not trigger it, so the build and the preview upload go unverified.
site-preview.yml no longer exists on FlowFuse/website. The definition moved to FlowFuse/github-actions-workflows as build_website.yml, so the old reference resolved to nothing. The inputs and secrets are unchanged, only the ref moves.
| netlify_site_id: ${{ secrets.NETLIFY_SITE_ID }} | ||
| # A reusable workflow reports its checks as "caller job / called job". This gate keeps the | ||
| # original context name and the publish dependency below intact. | ||
| test-with-website: |
There was a problem hiding this comment.
What is the purpose of the test-with-website job now?
There was a problem hiding this comment.
It keeps the Test Documentation with website check name reporting. A reusable workflow reports as "caller job / called job", so the build shows up as Build the website with these docs / Build and check and the old context stops existing. The required context on main would then be a name nothing publishes, and publish's needs would break too.
The alternative is to update the required contexts on main and point publish at needs: website, and then this job can go. Both would have to land together.
I'd keep it: one job, a few seconds, and no ruleset change tied to the merge. Let me know if you see it differently, you have the view on the protection settings that I don't.
There was a problem hiding this comment.
Please remove it and adjust the job's dependency - we do not need to spin another runner just to report the status of a previous job.
There was a problem hiding this comment.
Removed, and publish now needs website directly. Default needs semantics already stop publish on a failed or skipped build, so the gate's always() plus result check was only ever buying the name.
That name goes with it: the build reports as Build the website with these docs / Build and check and Test Documentation with website stops existing. If the old context is still in main's required checks it has to be swapped before this merges, otherwise main waits on a context nothing publishes. I cannot read the protection settings, so that part is on your side.
The gate existed only to keep publishing the old check name. A reusable workflow reports as "caller job / called job", so the website build now reports as "Build the website with these docs / Build and check" and publish depends on it directly.
|
@dimitrieh Seems convoluted, shouldn't we just move the docs to the website repo? |
Contributes to Website preview on documentation pull requests.
Replaces the copy of the website build in
docs.ymlwith a call tobuild_website/v1in FlowFuse/github-actions-workflows, and uploads the result to Netlify under adocs-pr-<number>alias so documentation pull requests get a preview URL.The deploy is aliased and unpublished, so netlify.toml's build command never runs against it and flowfuse.com keeps serving what it served before. Fork pull requests receive no secrets, so they build and link-check without uploading.
Draft until:
NETLIFY_AUTH_TOKENandNETLIFY_SITE_IDare available to this repositoryBuild the website with these docs / Build and checkin place ofTest Documentation with website