Deploy to Vercel
Deploy your Specra documentation to Vercel with zero configuration
Deploy to Vercel
Vercel is the easiest way to deploy your Specra documentation. It's built by the creators of SvelteKit, so everything works perfectly out of the box.
Why Vercel?
- Zero configuration - Automatic detection and setup
- Instant deployments - Live in under 60 seconds
- Automatic HTTPS - SSL certificates included
- Edge network - Fast loading worldwide
- Preview deployments - Every git push gets a URL
- Free tier - Generous limits for documentation sites
Quick Deploy
Push to GitHub
1git init2git add .3git commit -m "Initial commit"4git remote add origin https://github.com/username/repo.git5git push -u origin mainImport to Vercel
- Go to vercel.com/new
- Click "Import Git Repository"
- Select your documentation repository
- Vercel auto-detects SvelteKit and configures everything
No manual configuration needed!
Deploy
You'll get a production URL like `your-project.vercel.app`
Configuration
Vercel automatically uses these settings for SvelteKit projects:
| Setting | Value |
|---|---|
| Build Command | npm run build |
| Output Directory | ` |
| Install Command | npm install |
| Node Version | 20.x (latest LTS) |
Override Settings (Optional)
If you need custom settings, create vercel.json:
1{2 "buildCommand": "npm run build",3 "outputDirectory": "build",4 "installCommand": "npm ci",5 "framework": "sveltekit",6 "regions": ["iad1"]7}Environment Variables
Add environment variables in the Vercel dashboard:
Go to Project Settings
Add Variables
MEILISEARCH_HOST=https://search.example.com
MEILISEARCH_API_KEY=your-search-key
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
Redeploy
Custom Domain
Add your own domain to your Vercel project:
Add Domain
- Go to Project Settings → Domains
- Enter your domain (e.g.,
docs.example.com) - Click "Add"
Configure DNS
For subdomain (docs.example.com):
Type: CNAME
Name: docs
Value: cname.vercel-dns.com
For apex domain (example.com):
Type: A
Name: @
Value: 76.76.21.21
Wait for Verification
Vercel automatically provisions an SSL certificate once DNS is verified.
Automatic Deployments
Every git push triggers a deployment:
Production Deployments:
- Commits to
mainbranch deploy to production - Updates your live site automatically
Preview Deployments:
- Commits to other branches get preview URLs
- Pull requests get unique URLs for testing
- Perfect for reviewing changes before merging
Preview URLs
Each preview deployment gets a unique URL:
your-project-git-feature-branch-username.vercel.app
Share this with your team to review changes before going live.
Deployment Settings
Branch Configuration
Control which branches deploy:
- Go to Settings → Git
- Set Production Branch (usually
main) - Enable/disable preview deployments for other branches
Deployment Protection
Protect production deployments:
1{2 "git": {3 "deploymentEnabled": {4 "main": true,5 "staging": "preview"6 }7 }8}Performance Optimization
Vercel automatically optimizes your deployment:
- Edge caching - Static files cached globally
- Image optimization - optimized images optimized automatically
- Compression - Gzip/Brotli compression enabled
- HTTP/2 - Faster multiplexed connections
Analytics
Enable Vercel Analytics for free:
- Go to Analytics tab
- Click "Enable Analytics"
- Add the Analytics component to your layout
1// app/layout.tsx2import { Analytics } from '@vercel/analytics/react'3 4export default function RootLayout({ children }) {5 return (6 <html>7 <body>8 {children}9 <Analytics />10 </body>11 </html>12 )13}CI/CD Integration
Vercel acts as your CI/CD pipeline:
What runs on every deployment:
npm install(dependencies)npm run build(SvelteKit build)- Automatic checks and validations
- Deploy to edge network
GitHub Integration
Vercel comments on pull requests with:
- Preview deployment URL
- Build logs
- Performance insights
Build Logs
View detailed build logs:
- Go to Deployments
- Click any deployment
- View the Building section for logs
Troubleshooting
Build Fails
Check Node version:
Ensure you're using Node 18+. Add to package.json:
1{2 "engines": {3 "node": ">=18.0.0"4 }5}Clear build cache:
- Go to Settings → General
- Scroll to Build & Development Settings
- Clear build cache
Environment Variables Not Working
- Check variable names (case-sensitive)
- Prefix client-side variables with
NEXT_PUBLIC_ - Redeploy after changing variables
Custom Domain Not Working
- Verify DNS records are correct
- Wait for DNS propagation (check with
digornslookup) - Ensure CNAME points to
cname.vercel-dns.com - Check domain verification status in Vercel dashboard
Monorepo Deployment
If your docs are in a monorepo:
- Set Root Directory in project settings
- Point to your docs folder (e.g.,
apps/docs) - Vercel builds only that directory
1{2 "buildCommand": "cd ../.. && npm run build:docs",3 "outputDirectory": "build"4}Best Practices
Use preview deployments - Test changes before merging to main
Enable branch protection - Require preview deployment success before merging
Set up notifications - Get Slack/email alerts for deployment status
Monitor analytics - Track page views and performance
Use edge config - Store feature flags and config at the edge for instant updates
Pricing
Vercel's free tier includes:
- Unlimited deployments
- 100GB bandwidth/month
- Automatic HTTPS
- Preview deployments
- Analytics (basic)
This is usually enough for documentation sites. Upgrade to Pro if you need:
- More bandwidth
- Advanced analytics
- Password protection
- Enterprise support