[chore]: standardize makefile to npm run calls#158
Conversation
… update workflows to call hugo cmds from workflow env and make deployment non-indexable Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
|
🚀 Preview deployment: https://layer5io.github.io/academy-example/pr-preview/pr-158/
|
There was a problem hiding this comment.
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.
…workflows Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
|
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>
|
@ishwar170695 I've added the htmltest.yml config file |
Reviewed the latest changes. Looks good to me. |
Notes for Reviewers
Makefile /
package.jsonnpm run, makingpackage.jsonthe single source of Hugo flags.build-production,site-no-watch,check-links,format,format-check,check-deps.check-go check-depsprerequisites added to all build/serve/theme targets.HTMLTEST_VERSION ?= latest(+export) — single place to pin htmltest._serve→_site,serve→site,update:dep→update:pkg:dep,update:hugo→update:pkg:hugo.check:links:all/precheck:links:all, the no-op trailing--on_build/build, and the unused_local/localscripts (this repo uses thego.modreplacedirective for local theme development, not a Hugo workspace) along with theircross-envdependency.hugo-extendedas a devDependency, somake setupnow provides Hugo locally.build:productiongained--gc; serve uses canonicalhugo serverand no longer renders to memory._check:linksis explicitly stubbed (Skipped: go run …htmltest… -s) — link checking remains a no-op, now labelled.package-lock.jsonregenerated;npm cifails on mismatch.Build and Deploy Sitemake build-production BASE_URL=…→ directhugocall. Silent bug: nothing readBASE_URL— not the Makefile, notbuild:production. Hugo fell back tohugo.yaml'sbaseURL: 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--baseURLin the workflow.peaceiris/actions-hugokept — the build step callshugodirectly, andnode_modules/.binis not onPATHoutsidenpm run.Build and Preview Sitemake build-preview BASE_URL=…→ directhugocall. Silent bug:build:previewreads${DEPLOY_PRIME_URL:-/}(a Netlify variable, unset on GitHub Actions), so every preview built with--baseURL /and rendered unstyled with broken navigation at itspr-preview/pr-N/subpath. The PR URL is now computed and passed to--baseURL.Make preview non-indexable— preview URLs are public GitHub Pages. WritesDisallow: /torobots.txtand setsnoindex, nofollowon every built page so previews aren't crawled.peaceiris/actions-hugokept — same reason as above.Build and publish academySetup Go— required.make build-production→check-gohard-fails without it, and Hugo needs Go to resolve theacademy-thememodule.peaceiris/actions-hugo— redundant here.make setupinstallshugo-extendedintonode_modules/.bin, andmake build-productionreaches Hugo vianpm run(which puts.binonPATH). Dropping it also removes a second place the Hugo version was pinned.make build→make build-production— the step claims a production build test;buildis the dev build.academy-namenow reads its declaredworkflow_dispatchinput (${{ github.event.inputs.academy-name || 'Academy' }}) instead of being hardcoded. Added the missingtype: string.Setup Node(20 + npm cache);checkout@v5→@v6withfetch-depth: 0.On the peaceiris asymmetry
peaceiris/actions-hugois kept in the two site workflows and removed from the publish workflow. This is intentional: the site workflows invokehugodirectly in arun:step, wherenode_modules/.binis not onPATH; the publish workflow reaches Hugo throughnpm run, which puts it there.Breaking
npm run serve,_serve,local,update:dep,update:hugo,check:links:allno longer exist.make buildnow means the dev build; usemake build-productionfor production.BASE_URLis no longer read by anymaketarget — base URLs are supplied by the workflows.Signed commits