Hi guys,
I’ve got a static site that uses content from a headless CMS. When the content is published, the webhook is sent to Netlify, and the build trigger runs a new production build from the master branch with my published content.
Also, my headless CMS’s got unpublished content available via a separate API endpoint with a secret API key. I can easily distinguish between those two and use the appropriate command to build my site using production or preview API. Also, I’ve got another webhook request that can trigger build after every content change in this preview environment.
How should I design this in Netlify? Basically, I need two builds/environments for the same master branch but with different build commands (and different production/preview URLs). Should I make two separate sites? One for production and one for preview content environment? Can I somehow design this with just one site - this means different build commands with their respective webhooks trigger with two different URLs (public and preview) but for just one master branch?
Thank you.