This guide is written for someone who has not done backend work before. Follow it top to bottom and the site will be live with a working CMS at the end.
You should have:
automation-studio-siteproduction and choose public read accessa1b2c3d4. You’ll need this in Step 3.That’s it for now. We’ll come back to add a project (the content) once the site is wired up.
The site uses a shared secret to make sure only Sanity can trigger live updates. Open a terminal and run:
openssl rand -hex 32
You’ll get a long random string. Copy it somewhere safe — you’ll paste it twice (once into Vercel, once into Sanity).
If you want to run the site on your laptop before deploying:
cp .env.example .env.local
.env.local in any text editor and fill in:
NEXT_PUBLIC_SANITY_PROJECT_ID="paste-your-project-id-from-step-1"
NEXT_PUBLIC_SANITY_DATASET="production"
NEXT_PUBLIC_SANITY_API_VERSION="2025-01-01"
SANITY_REVALIDATE_SECRET="paste-the-secret-from-step-2"
npm install
npm run dev
If both pages load, you’re good. Stop the server with Ctrl+C.
If the repo is already on GitHub (the existing cold7-yes/portfolio remote), just commit and push:
git add -A
git commit -m "Rebuild as automation studio site with Sanity"
git push
If you want a brand new repo instead, create one on github.com and follow GitHub’s instructions to push.
Before clicking Deploy, scroll to Environment Variables and add these four:
| Name | Value |
|---|---|
NEXT_PUBLIC_SANITY_PROJECT_ID |
(from Step 1) |
NEXT_PUBLIC_SANITY_DATASET |
production |
NEXT_PUBLIC_SANITY_API_VERSION |
2025-01-01 |
SANITY_REVALIDATE_SECRET |
(from Step 2) |
When it’s done, Vercel gives you a live URL like https://your-project.vercel.app.
This is what makes content edits show up on the live site without a redeploy.
Vercel revalidationhttps://your-project.vercel.app/api/revalidate?secret=PASTE_THE_SECRET_FROM_STEP_2
(replace your-project.vercel.app with your real Vercel URL, and paste the actual secret)production_type == "project"POSThttps://your-project.vercel.app/studioIf it doesn’t show up:
Edit these files for the human-readable bits:
| File | What to change |
|---|---|
src/components/Header.tsx |
Wordmark / brand name |
src/components/Hero.tsx |
Headline, subhead, CTA |
src/components/Services.tsx |
The three service descriptions |
src/components/Tools.tsx |
The list of tools you actually use |
src/components/ContactCTA.tsx |
Your real email address (CONTACT_EMAIL) |
src/app/layout.tsx |
Browser tab title and OG metadata |
Commit and push — Vercel auto-deploys on every push to main.
“Missing environment variable: NEXT_PUBLIC_SANITY_PROJECT_ID”
You forgot to set the env vars in Vercel (Step 5) or in .env.local (Step 3). Add them and redeploy.
/studio shows a blank screen
Check your browser console. Most often this means the project ID env var is wrong, or your Sanity user doesn’t have access to the project.
New project doesn’t appear on the live site
SANITY_REVALIDATE_SECRET you set in Vercel