- netlify site name: Example:
raicyt.netlify.app
- custom domain: raicyt.org.ar
- Build problems: None
- Did you try our generative AI chatbot, before posting? YES
Hi! I understand that deploy-previews are built when doing pull requests and merges at the upstream repo. But how can I generate both production + preview deploys at the same time from the current branch (e.g. triggered by a normal commit in continuous deployment).
My site is generated by HUGO, and in my netlify.toml I have both commands to build/deploy for production and for previews (see below).
Essentially I’d like to use deploy-previews to see future posts and posts labeled as “drafts” in my site.
But in my netlify dashboard I don’t see where these previews are deployed or can be seen, or if I need to to anything else to get this done.
[build]
command = "hugo --gc --minify -b $URL && npx pagefind --source 'public'"
publish = "public"
[build.environment]
HUGO_VERSION = "0.119.0"
HUGO_ENABLEGITINFO = "true"
[context.production.environment]
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture --buildDrafts -b $DEPLOY_PRIME_URL && npx pagefind --source 'public'"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
Because I am the only developer, and there is only a single branch in the repo, there is really no need to do branching or pull requests. Can netlify build the previews as specified in context.deploy-preview
?
Thanks in advance for any help. Best – fernan