π¦ ClawHub
Web Deploy
by @cmanfre7
Build, preview, and deploy websites, web apps, and APIs using Vercel, Railway, GitHub Pages, or local Canvas environments.
TERMINAL
clawhub install web-deployπ About This Skill
web-deploy
Build and deploy websites, web apps, and APIs to production.
Local Preview Workflow
# Static site
npx http-server ./dist -p 8080 -c-1Next.js
npm run dev # Development (hot reload)
npm run build && npm run start # Production previewFastAPI
uvicorn app.main:app --reload --port 8000Vite-based
npm run dev # Dev server
npm run build && npx serve dist # Production preview
Deployment Targets
Vercel (Frontend / Next.js / Static)
# First time setup
npx vercel linkPreview deployment
npx vercelProduction deployment
npx vercel --prodEnvironment variables
npx vercel env add SECRET_KEY
Best for: Next.js apps, React SPAs, static sites, serverless functions.
Config: vercel.json (usually not needed for Next.js)
{
"buildCommand": "npm run build",
"outputDirectory": "dist",
"framework": "nextjs"
}
Railway (Backend / APIs / Databases)
# First time setup
railway login
railway initDeploy
railway upAdd database
railway add --plugin postgresqlEnvironment variables
railway variables set SECRET_KEY=valueView logs
railway logs
Best for: Backend APIs, databases, long-running processes, Docker containers.
GitHub Pages (Static Sites)
# Using gh-pages package
npm install -D gh-pages
Add to package.json scripts: "deploy": "gh-pages -d dist"
npm run build && npm run deploy
Best for: Documentation, simple static sites, project pages.
Canvas (Clawdbot Workspace)
Deploy to ~/clawd/canvas/ for local serving through the clawdbot gateway.
cp -r ./dist/* ~/clawd/canvas/my-project/
Pre-Deploy Checklist
npm run build / python -m build).env / secrets NOT in gitrobots.txt and sitemap.xml if public siteRollback
# Vercel β redeploy previous
npx vercel rollbackRailway β redeploy previous
railway rollbackGit-based β revert and push
git revert HEAD && git push
Domain Setup
# Vercel
npx vercel domains add mydomain.comDNS: Point CNAME to cname.vercel-dns.com
Or A record to 76.76.21.21