Generate previews on demand via Netlify's API with Github integration

Yes, it would trigger a change on the production as @hillary said, there’s no real way to trigger a PR from API.

So your workflow would be:

Build a production deploy → Lock publishing (possible via API) → Tigger the preview builds as explained above → Since publishing is locked, the content on production URL won’t change, so if you wish to change it trigger yet another deploy same as above → Publish it (again, via API).

Basically, you can build multiple times, but publish it live only once as you need it.

1 Like