Sanity Studio Dashboard Widget for triggering webhook deploys.
To get dashboard support in Sanity Studio in general:
sanity install @sanity/dashboard
sanity install dashboard-widget-webhook-deploy
- Implement your own dashboardConfig. In your
sanity.json
file, append the following line to theparts
array:
{
"implements": "part:@sanity/dashboard/config",
"path": "src/dashboardConfig.js"
}
- Create the file
src/dashboardConfig.js
and inlcude thewebhook-deploy
widget config like this:
export default {
widgets: [
{
name: 'webhook-deploy',
options: {
builds: [
{
name: 'SE',
buildHook: 'https://webhook.example.se',
siteUrl: 'example.se',
},
],
previews: [
{
name: 'SE',
previewHook: 'https://webhook.preview.example.com',
previewUrl: 'https://preview-example.com/',
},
],
overrideStrings: {
title: 'Deploy to production',
previewTitle: 'Previw',
previewLinkText: 'Go to preview site',
previewButtonText: 'Start preview server',
errorMessage: 'Could not deploy',
},
},
},
],
}