My thought on how to solve
for my Hugo module in
which I currently have unlinked from the last deploy on: image-handling-mod.netlify.app
since I do not currently have the demo/test site in the same repo (or any repo at the moment).
My thought is to create a new repo with the demo/test for which the image-handling-mod-hugo-dfd
triggers a build of the demo/test site (which pulls in the module via Hugo’s wrapper around Go modules) , and requires Netlify return a success deploy results before treat the action successful.
I have three questions:
- Is this something that is possible to do (e.g. vie
netlify-cli
), and - Would it make more sense to use a build script in the
image-handling-mod-hugo-dfd
repo that grabs the demo/test site repo and uses ‘module replacements’ to use the local (in the runner/build environment) copy of the module instead of pulling GitHub’s version (so that it’s the version being pushed / merged) and builds the demo/test site?- If so, in a Netlify build environment, is the repo that was pushed to trigger the build in a subdirectory of
$HOME
or does the repo become$HOME
? - How stable are things like knowing where the trigger repo is, and in what state, and where any cloned directory, and any build directory are located?
- If so, in a Netlify build environment, is the repo that was pushed to trigger the build in a subdirectory of
- Am I am missing an obvious easier and/or better way to achieve this?
EDIT: I have new idea. Because the demo/test site is a module, and Hugo accepts a --config
parameter for custom named config files, in my module I ought to be able have e.g. config-ci.toml
which imports the demo/test site and uses the current repo via Hugo’s mounts so that I can deploy a CI-only site on Netlify.
I will let everyone know how it goes in case someone else someday wants to achieve the same thing.