Deploy from Sanity

·view .md ↗·chatgpt ↗·claude ↗

To set up a Netlify Build Hook for Sanity, follow these steps:

  1. Inside the Netlify project, go to: Project configuration > Build y deploy > Build hooks > Add build hook
  2. Fill in the fields:
    • Build hook name: Deploy from Sanity
    • Branch to build: main
  3. Click Save.
  4. Netlify will generate a URL similar to: https://api.netlify.com/build_hooks/yyyyxxxxxyyyxxdxxx
  5. The numbers and letters part yyyyxxxxxyyyxxdxxx is what you need to copy into the cms/env.local file.
  6. Finally, deploy your Sanity project with:
    sanity deploy
    

If everything went well, you should now be able to trigger deploys from Sanity Studio > Deploy.