Skip to content

[chore]: standardize makefile to npm run calls#158

Open
banana-three-join wants to merge 4 commits into
layer5io:masterfrom
banana-three-join:chore/banana-three-join/standardize-makefile
Open

[chore]: standardize makefile to npm run calls#158
banana-three-join wants to merge 4 commits into
layer5io:masterfrom
banana-three-join:chore/banana-three-join/standardize-makefile

Conversation

@banana-three-join

@banana-three-join banana-three-join commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Notes for Reviewers

Makefile / package.json

  • All Makefile recipes now route through npm run, making package.json the single source of Hugo flags.
  • Added targets: build-production, site-no-watch, check-links, format, format-check, check-deps.
  • check-go check-deps prerequisites added to all build/serve/theme targets.
  • HTMLTEST_VERSION ?= latest (+ export) — single place to pin htmltest.
  • Renamed scripts: _serve_site, servesite, update:depupdate:pkg:dep, update:hugoupdate:pkg:hugo.
  • Removed orphaned check:links:all / precheck:links:all, the no-op trailing -- on _build / build, and the unused _local / local scripts (this repo uses the go.mod replace directive for local theme development, not a Hugo workspace) along with their cross-env dependency.
  • Added hugo-extended as a devDependency, so make setup now provides Hugo locally.
  • build:production gained --gc; serve uses canonical hugo server and no longer renders to memory.
  • _check:links is explicitly stubbed (Skipped: go run …htmltest… -s) — link checking remains a no-op, now labelled.
  • package-lock.json regenerated; npm ci fails on mismatch.

Build and Deploy Site

  • make build-production BASE_URL=… → direct hugo call. Silent bug: nothing read BASE_URL — not the Makefile, not build:production. Hugo fell back to hugo.yaml's baseURL: http://localhost:9876/academy/, so the deployed Pages site had every link and asset pointing at localhost. The GitHub Pages URL is per-fork, so it is now computed and passed to --baseURL in the workflow.
  • peaceiris/actions-hugo kept — the build step calls hugo directly, and node_modules/.bin is not on PATH outside npm run.

Build and Preview Site

  • make build-preview BASE_URL=… → direct hugo call. Silent bug: build:preview reads ${DEPLOY_PRIME_URL:-/} (a Netlify variable, unset on GitHub Actions), so every preview built with --baseURL / and rendered unstyled with broken navigation at its pr-preview/pr-N/ subpath. The PR URL is now computed and passed to --baseURL.
  • Added Make preview non-indexable — preview URLs are public GitHub Pages. Writes Disallow: / to robots.txt and sets noindex, nofollow on every built page so previews aren't crawled.
  • peaceiris/actions-hugo kept — same reason as above.

Build and publish academy

  • Added Setup Go — required. make build-productioncheck-go hard-fails without it, and Hugo needs Go to resolve the academy-theme module.
  • Removed peaceiris/actions-hugo — redundant here. make setup installs hugo-extended into node_modules/.bin, and make build-production reaches Hugo via npm run (which puts .bin on PATH). Dropping it also removes a second place the Hugo version was pinned.
  • make buildmake build-production — the step claims a production build test; build is the dev build.
  • academy-name now reads its declared workflow_dispatch input (${{ github.event.inputs.academy-name || 'Academy' }}) instead of being hardcoded. Added the missing type: string.
  • Added Setup Node (20 + npm cache); checkout@v5@v6 with fetch-depth: 0.

On the peaceiris asymmetry

peaceiris/actions-hugo is kept in the two site workflows and removed from the publish workflow. This is intentional: the site workflows invoke hugo directly in a run: step, where node_modules/.bin is not on PATH; the publish workflow reaches Hugo through npm run, which puts it there.

Breaking

  • npm run serve, _serve, local, update:dep, update:hugo, check:links:all no longer exist.
  • make build now means the dev build; use make build-production for production.
  • BASE_URL is no longer read by any make target — base URLs are supplied by the workflows.

Signed commits

  • Yes, I signed my commits.

… update workflows to call hugo cmds from workflow env and make deployment non-indexable

Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🚀 Preview deployment: https://layer5io.github.io/academy-example/pr-preview/pr-158/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the project's build and maintenance workflows by updating the Makefile and package.json scripts, removing cross-env, and introducing Prettier for code formatting. Feedback on these changes highlights two critical issues in package.json: first, the build:production script is missing the required -D and --buildFuture flags needed to render draft examples in production; second, the postbuild:preview script has removed the necessary search engine indexing protection for preview deployments, which should be restored.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread package.json
Comment thread package.json
…workflows

Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
Comment thread package.json Outdated
Comment thread package.json Outdated
@ishwar170695

Copy link
Copy Markdown

Compared to the Exoscale baseline, I noticed .htmltest.yml isn't included here. Was that intentionally left out, or should it also be propagated?

Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
@banana-three-join

Copy link
Copy Markdown
Contributor Author

@ishwar170695 I've added the htmltest.yml config file

@ishwar170695

Copy link
Copy Markdown

@ishwar170695 I've added the htmltest.yml config file

Reviewed the latest changes. Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize Makefiles across all meshery-academy repositories

2 participants