sanity-io / sanity-plugin-dashboard-widget-netlify

Sanity Studio Dashboard Widget for triggering Netlify builds
MIT License
31 stars 14 forks source link

[Feature] Netlify branch deploy build status #7

Closed mornir closed 4 years ago

mornir commented 4 years ago

For a client, I wanted to set up a staging website where he can preview his changes and easily share the URL. I used Netlify branch deploy with the URL https://staging--website.netlify.com. In the dashboard widget, I registered the production website and the staging website, with each its own build hook.

Everything worked fine, except that both Netlify badges are linked with the production website. I've looked online and it seems that it's not possible to get badges for branch deploys.

It's a pity because this badge is a clever and easy way to show the build status. Do you have an idea how to show the build status for branch deploys inside the widget? In Netlify CMS, the user has to click the button "Check for preview" to see if the preview is ready.

Another way would be to provide a setting to at least hide the badge.

mornir commented 4 years ago

The solution is to create a separate preview site in Netlify and add the two sites to this widgets. This is actually what Conteful is doing: https://www.contentful.com/developers/docs/extensibility/apps/netlify/