fix(templates): make shipped build.yml compatible with Hugo v0.161

The shipped per-template GitHub Actions build workflow still pinned
Node 20 and fell back to Hugo 0.154.5 on missing config - both
incompatible with Hugo v0.161's css.TailwindCSS Node permission sandbox
(Node >= 22, npm @tailwindcss/cli required). Sites upgraded via
`hugoblox upgrade` (which only touches go.mod) hit this immediately.

- Bump NODE_VERSION 20 -> 22 in all 9 templates' .github/workflows/build.yml
- Bump fallback DEFAULT_VERSION 0.154.5 -> 0.161.0 to match the framework's
  new module.hugoVersion.min
- Add a "Verify Tailwind CSS dependency" step that fails fast with an
  actionable ::error message if @tailwindcss/cli is not resolvable,
  replacing Hugo's cryptic "binary tailwindcss is not a Node.js script"
This commit is contained in:
George Cushen committed 2026-05-02 03:08:09 +01:00
1 parent 23e0bb1269
commit 8fb7186068
9 files changed
+108 -18

No files matched your search

+12 -2
View File
@@ -1,7 +1,7 @@
name: Build
env:
NODE_VERSION: '20'
NODE_VERSION: '22'
on:
# Standalone trigger for PR validation
@@ -65,7 +65,7 @@ jobs:
VERSION=$(yq '.build.hugo_version // ""' hugoblox.yaml 2>/dev/null | grep -v '^null$' || true)
# Fallback to a known stable version if not specified
DEFAULT_VERSION="0.154.5"
DEFAULT_VERSION="0.161.0"
VERSION=${VERSION:-$DEFAULT_VERSION}
# Validate version format (basic check)
@@ -85,6 +85,16 @@ jobs:
pnpm install --no-frozen-lockfile || npm install
fi
- name: Verify Tailwind CSS dependency
if: hashFiles('package.json') != ''
run: |
if ! node -e "require.resolve('@tailwindcss/cli/package.json')" 2>/dev/null; then
echo "::error title=Missing dependency '@tailwindcss/cli'::Hugo >= 0.161.0 requires the npm @tailwindcss/cli package. Add it to package.json:"
echo "::error:: pnpm add @tailwindcss/cli tailwindcss"
echo "::error::See https://github.com/HugoBlox/kit for upgrade instructions."
exit 1
fi
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with: