Skip to content

Refactor doc publication: build in GH Actions, Netlify only for non-main branch previews #441

Description

@ascheman

Problem

netlify.toml currently carries a full build command that runs the
doctoolchain (Jekyll + Gradle + asciidoctor + …) on Netlify itself:

command = "jekyll build && cd ../../.. && \
           ./gradlew generateDocs && \
           cp -r ./build/docs/html5/ src/docs/website/_site/documentation"

That couples our doc deployment to Netlify's build environment:

  • Netlify's image must keep providing JDK + Ruby + the docToolchain
    toolchain at versions we support; any upstream image change can
    break us with no signal until the next push.
  • We have no way to reproduce a Netlify build locally other than by
    pushing to Netlify; debugging is painful.
  • Every push triggers the same expensive doc build twice — once in
    GH Actions for the gh-pages.yml flow, once on Netlify.

What we want

  • One build, in GH Actions, with full visibility and reproducibility.
  • main continues to deploy to GitHub Pages (current behaviour).
  • Feature/bugfix branches and pull requests get a Netlify preview
    URL
    automatically, posted as a PR comment so reviewers can click
    through without checking out.

How

  • Strip the [build] command out of netlify.toml. Keep only the
    publish directory + any redirects/functions. Netlify becomes a
    pure hosting target.
  • Extend the existing GH Actions docs workflow so that, once it has
    produced the rendered site:
    • If the ref is main → deploy to GitHub Pages (today's path).
    • Otherwise (feature/, bugfix/, pull_request) → upload the
      artifact via a pinned-SHA Netlify deploy action, capture the
      preview URL, post it as a PR comment when applicable.
  • Pin the Netlify deploy action to a commit SHA per
    githubactions:S7637.

Acceptance criteria

  • netlify.toml no longer contains a [build] command.
  • Pushing to main continues to update the GitHub Pages site
    with no behavioural change.
  • Pushing to a feature/* or bugfix/* branch publishes a
    Netlify preview at a stable per-branch URL.
  • Opening a PR adds a comment with the Netlify preview URL.
  • The doc build runs only in GH Actions; Netlify just hosts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions