Skip to content

Let docs-publish build both staging and prod, and dispatch to docs-publish - #126

Merged
recrwplay merged 12 commits into
devfrom
build-both-envs
Sep 4, 2026
Merged

Let docs-publish build both staging and prod, and dispatch to docs-publish#126
recrwplay merged 12 commits into
devfrom
build-both-envs

Conversation

@recrwplay

Copy link
Copy Markdown
Contributor

Summary

  • docs-publish.yml's prepare-ref-env job now resolves a list of independent builds ({buildRef, dispatchEnv, publishEnv}) instead of one shared build-ref plus an environments label array.
  • Rule: a push/dispatch on the dev branch builds staging only (a dev-only change has no bearing on prod's published content); a push/dispatch on the prod branch, or DEV_BRANCH == PROD_BRANCH, or any other branch, builds both. This assumes the push trigger's branch list is the union of every branch referenced in the staging and prod Antora publish playbooks - documented inline where it matters.
  • trigger-generate-html dispatches docs-generate-html.yml once per build in that list - each remains a fully independent workflow run (not a matrix in one run), so no artifact-name collisions and no changes needed in reusable-docs-build.yml/reusable-docs-verify.yml.
  • docs-generate-html.yml gains a publish-html job that dispatches a publish-html event to the docs-publish repo via peer-evans/repository-dispatch, mirroring the pattern already live in docs-aura's copy of this workflow. This was previously missing entirely - the sandbox harness built and verified HTML but never handed off to publish.

Test plan

  • Validated YAML syntax on both edited files.
  • Dispatched docs-publish.yml from a non-dev branch with no separate PROD_BRANCH configured - confirmed exactly one build resolves (staging), matching the "nothing to double up" case.
  • Temporarily set PROD_BRANCH and a matching deployment-branch-policy entry to exercise the two-build path - confirmed two independent docs-generate-html.yml runs are triggered (one dev/staging, one prod), each completing with its own normally-named artifacts (no collisions, since they're separate runs). Test-only config reverted afterward.
  • Confirmed the new publish-html job successfully dispatches to docs-publish, and that docs-publish's own check-build-branch step safely rejects it end-to-end (docs-tools has no vars.DOCS_DEV_BRANCH/DOCS_PROD_BRANCH configured, so nothing actually gets published from this sandbox run).

Adds a build-both workflow_dispatch input. prepare-ref-env now outputs a
list of independent builds (each with its own build-ref) instead of one
shared build-ref plus an environments label array, so trigger-generate-html
can dispatch docs-generate-html.yml once per build - still fully separate
runs, so no artifact-naming changes needed anywhere.
Drops the manual target-env/build-both input entirely - dispatching
from the dev branch already gives staging-only, and dispatching from
anything else already gives both, with no input needed. Only a change
on the dev branch is known for certain not to affect prod, so every
other trigger rebuilds both rather than trying to detect which one
"actually changed".
Mirrors the pattern already working in docs-aura's docs-generate-html.yml
(peter-evans/repository-dispatch to docs-publish), minus the matrix -
this workflow already runs once per environment via docs-publish.yml's
per-build dispatch loop. Sends dispatch-env (dev/prod) as publish_env,
matching what docs-publish's check-build-branch step expects.
docs-generate-html.yml derives publish-env itself from build-ref against
its own vars.DOCS_PROD_BRANCH, the same pattern already used elsewhere
in this session - removes the need for docs-publish.yml to compute and
pass it through, so that input is dropped entirely.
…ch case

Deriving publish-env from build-ref alone breaks when DOCS_DEV_BRANCH ==
DOCS_PROD_BRANCH: docs-publish.yml dispatches the same build-ref twice
to get one dev-labeled and one prod-labeled run, and build-ref alone
can't tell those two dispatches apart. dispatch-env is now optional
(blank = derive from build-ref, as before) and docs-publish.yml only
passes it explicitly in that one case. A new resolve-env job derives
both dispatch-env and publish-env from the same resolved value once,
so an explicit override correctly overrides both rather than just one.
reusable-docs-build.yml was the only place using staging/prod - every
other part of the publish pipeline (docs-publish's vars, dispatch-env,
DOCS_DEV_BRANCH/DOCS_PROD_BRANCH) already speaks dev/prod. No caller
(docs-aura, docs-http-api, docs-dataflow-connector) passes the literal
string 'staging' explicitly - confirmed via search - so this only
changes the default value, not any caller's actual behavior.
Now that reusable-docs-build.yml's publish-env speaks the same dev/prod
vocabulary as dispatch-env, they were fully redundant - one value now
feeds both, removing the duplicate output and the now-stale comments
explaining the vocabulary split.
Not the only valid wiring: a repo with clean separate dev/main branches
should give docs-generate-html.yml its own direct per-branch push
trigger instead (docs-aura's existing pattern) - never build both
environments from one commit when they're genuinely separate content.
dispatch-env and publish-env were the same value under two different
names once the vocabulary was unified - reusable-docs-build.yml's input
and the docs-publish payload were already publish-env/publish_env, so
docs-generate-html.yml's own input was the odd one out.
@neo4j-docops-agent

neo4j-docops-agent commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@recrwplay
recrwplay merged commit 022f3be into dev Sep 4, 2026
12 checks passed
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