Skip to content

fix(cicd): update version dropdown in old releases#97

Closed
LorenzBischof wants to merge 1 commit into
projectcapsule:mainfrom
LorenzBischof:main
Closed

fix(cicd): update version dropdown in old releases#97
LorenzBischof wants to merge 1 commit into
projectcapsule:mainfrom
LorenzBischof:main

Conversation

@LorenzBischof

@LorenzBischof LorenzBischof commented Jul 2, 2026

Copy link
Copy Markdown

The problem

Every release/* branch carries its own hardcoded params.versions list, frozen at the point the branch was cut. So if you open an older version, its dropdown only shows the versions that existed back then and the newer releases are missing. The only way to fix an old site's dropdown today is to rebuild that branch by hand, which never happens.

There is also no archived banner, that notifies a reader that the current version is outdated.

What this changes

Versioned docs now build from a single workflow onto one GitHub Pages site. Any change on any release/* branch triggers the build and deployment. Versions are now located at subpaths: /v0.12, /v0.13 etc.

The deployed website now follows the latest release branch and not main. To deploy the website, the changes must be merged into that release branch.

Netlify keeps handling main and PR previews, and 301-redirects the old release-0-XX subdomains to the new subpaths so existing links keep working.

Hugo is pinned to 0.122.0 on purpose: that's the version the live sites were actually built with, and newer Hugo dropped the resources.GetRemote .Err API that chart-version.html relies on. Upgrading should be done in a separate PR.

Rollout (needs doing outside this PR)

Currently the old release/0.10-0.13 branches do not contain deploy-trigger.yml. If we want to backport content, we either have to add that file or trigger the pipeline manually.

Testing

Ran the full build on my fork (LorenzBischof/capsule-website): https://lorenzbischof.ch/capsule-website/ Since the deploy previews use Netlify, the version selector uses the versions that are commited to the repository and not the generated versions from the build pipeline.

Copilot AI review requested due to automatic review settings July 2, 2026 11:24
@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for docs-projectcapsule ready!

Name Link
🔨 Latest commit 44765ce
🔍 Latest deploy log https://app.netlify.com/projects/docs-projectcapsule/deploys/6a464a8a413bce00089a3c54
😎 Deploy Preview https://deploy-preview-97--docs-projectcapsule.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the docs deployment so that all release/* branches are built into a single GitHub Pages site with per-version subpaths (/vX.Y/) and a consistent version dropdown across old releases, plus redirects from legacy per-version subdomains.

Changes:

  • Add a multi-version build script that discovers origin/release/X.Y branches, injects per-version params, and builds each version into public/vX.Y plus the latest to the site apex.
  • Update the GitHub Pages workflow to fetch release/* refs, pin Hugo to 0.122.0, install yq, and run the multi-version build script.
  • Add Netlify redirects from release-0-XX.projectcapsule.dev to projectcapsule.dev/v0.XX/ and introduce a release/** push-trigger workflow that dispatches the Pages deploy workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
scripts/build-site.sh New script to build and parameterize all released doc versions into one output tree (apex + /vX.Y/).
netlify.toml Adds redirects from legacy release subdomains to the new /vX.Y/ paths.
.github/workflows/hugo.yaml Pages build now fetches release/*, pins Hugo, installs yq, and runs the multi-version build.
.github/workflows/deploy-trigger.yml Dispatches the Pages deploy workflow on pushes to release/** branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build-site.sh
Comment on lines +56 to +57
npm ci --no-audit --no-fund >/dev/null 2>&1 \
|| npm install --no-audit --no-fund >/dev/null 2>&1 || true
Comment thread netlify.toml
Comment on lines 11 to +15
HUGO_VERSION = "0.145.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
GO_VERSION = "1.24.1"
NODE_VERSION = "23.6.0"
NODE_VERSION = "23.6.0"
Comment thread scripts/build-site.sh
Comment on lines +42 to +44
git worktree add --force --detach "${wt}" \
"origin/release/${version}" >/dev/null
(
@sandert-k8s

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! Nice addition.

In this PR, there will be a switch from Netlify to Github Docs when you click on a versioned page. We would like to have everything in Netlify. Sorry for that things weren't as clear; I just opened a new PR to delete all old Hugo/github pages references.

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.

3 participants