Automatic Sanity Studio Deploy

#Sanity
#GitHub Actions

The Setup

To make this work, you'll need to create a new API token in Sanity to put in the Github Repository as a Secret:

1.) Go to https://www.sanity.io/manage and find the desired Sanity project.

2.) Select API in the Project Settings.

3.) Under Tokens, create a new token called SANITY_AUTH_TOKEN as a deploy token:

4.) Create the token, copy it. and add it to your GitHub repo in Settings then add the Secret.

5.) Boom! You're all set to add the code to your .github/workflows folder to enable GH Actions.

The Code

.github/workflows/build-studio.yaml