Deployment Manager
Context
Use this skill to deploy projects, configure CI/CD, manage environment variables, monitor deployment health, or execute rollbacks. Covers GitHub Pages, Vercel, and Netlify.
Trigger phrases: "deploy to Vercel/Netlify/GitHub Pages," "configure CI/CD," "rollback deployment," "monitor uptime," "environment variables."
Instructions
Step 1: Pre-Deployment Checklist
- Build locally:
npm run build — no errors, reasonable bundle size.
- Test:
npm run test -- --coverage + npm run lint — all pass.
- Environment: create
.env.example (document vars, no secrets), verify .gitignore includes .env*.
- Git: all changes committed, correct branch (
main), no untracked files.
Step 2: Platform Deployment
GitHub Pages
- Static sites only. Add
.github/workflows/deploy.yml with actions/deploy-pages.
- Set output directory (
dist/build). Settings → Pages → Source: GitHub Actions.
- For SPAs: add
404.html redirecting to index.html. Set base in build config.
Vercel
- Connect repo or
npx vercel. Auto-detects framework; override build/output commands if needed.
- Set env vars in Project Settings → Environment Variables (Production/Preview/Dev).
- Custom domain: add in Settings → Domains. DNS: CNAME to
cname.vercel-dns.com or A record 76.76.21.21. SSL auto-provisioned.
Netlify
npm i -g netlify-cli && netlify init. Set build command and publish directory.
- Redirects in
netlify.toml: [[redirects]] from="/*" to="/index.html" status=200.
- Set env vars in Site Settings → Environment.
Step 3: SSL & CDN
- All platforms auto-provision SSL (Let's Encrypt). Verify HTTPS is active.
- Cache headers for hashed assets:
Cache-Control: public, max-age=31536000, immutable.
- Lighthouse audit: target Performance > 90, Accessibility > 90. Core Web Vitals: LCP < 2.5s, FID < 100ms, CLS < 0.1.
Step 4: Monitoring
- Uptime: UptimeRobot (free, 1-5 min checks) or BetterUptime.
- Errors: Sentry (free tier). Add
Sentry.init({ dsn }) in app entry.
- Alerts: email on > 5 errors/hour, Slack on > 10 errors/hour.
- Performance: Vercel Speed Insights or Netlify Analytics. Track load times, API latency, bundle size trends.
Step 5: Update & Rollback
- Update flow: Pull → Install → Test → Build → Push to main → CI runs → Verify → Smoke test → Monitor 15 min.
- Rollback by platform:
- Vercel: Dashboard → Deployments → "..." → Promote to Production (30s)
- Netlify: Dashboard → Deploys → Rollback previous
- GitHub Pages:
git revert [hash] → push → Actions redeploys
- Smoke test: homepage loads, nav works, key flows function, no console errors, assets load, APIs respond.
Constraints
- NEVER deploy locally to production for team projects. Always use CI/CD.
- NEVER commit secrets. Use platform UI or encrypted secrets.
- ALWAYS test on preview before promoting to production.
- ALWAYS have a rollback plan before deploying.
- NEVER skip the post-deploy smoke test.
- Environment variables MUST be documented in
.env.example.
- SSL MUST be active on production.
- Deploy logs MUST be checked for warnings even on successful builds.
Examples
Example 1: React SPA → Vercel
Project: React + TypeScript + Vite portfolio
1. npm run build → dist/
2. Push to GitHub main → Vercel auto-deploys
3. Env vars: VITE_API_URL, VITE_CONTACT_EMAIL
4. Domain: portfolio.jane.dev → CNAME cname.vercel-dns.com
5. SSL auto, Lighthouse 96/98/100
6. Sentry for errors, UptimeRobot 5-min pings
Rollback: Vercel dashboard → Promote previous deploy
Example 2: Docs Site → GitHub Pages
Project: Astro + Tailwind documentation
1. .github/workflows/deploy.yml → actions/deploy-pages
2. Push main → Actions builds and deploys
3. Domain: docs.project.com → CNAME github.io
4. Enable Enforce HTTPS toggle
5. 404.html for SPA routing fallback
6. UptimeRobot 1-min checks → Slack alerts
7. Weekly Lighthouse via cron GitHub Action
Rollback: git revert [hash] → push → Actions redeploys
1---2name: deployment-manager3description: Deploy projects, configure CI/CD, manage environment variables, monitor deployment health, and execute rollbacks. Covers GitHub Pages, Vercel, and Netlify.4---56# Deployment Manager78## Context910Use this skill to deploy projects, configure CI/CD, manage environment variables, monitor deployment health, or execute rollbacks. Covers GitHub Pages, Vercel, and Netlify.1112**Trigger phrases:** "deploy to Vercel/Netlify/GitHub Pages," "configure CI/CD," "rollback deployment," "monitor uptime," "environment variables."1314---1516## Instructions1718### Step 1: Pre-Deployment Checklist19201. **Build locally:** `npm run build` — no errors, reasonable bundle size.212. **Test:** `npm run test -- --coverage` + `npm run lint` — all pass.223. **Environment:** create `.env.example` (document vars, no secrets), verify `.gitignore` includes `.env*`.234. **Git:** all changes committed, correct branch (`main`), no untracked files.2425### Step 2: Platform Deployment2627#### GitHub Pages285. Static sites only. Add `.github/workflows/deploy.yml` with `actions/deploy-pages`.296. Set output directory (`dist`/`build`). Settings → Pages → Source: GitHub Actions.307. For SPAs: add `404.html` redirecting to `index.html`. Set `base` in build config.3132#### Vercel338. Connect repo or `npx vercel`. Auto-detects framework; override build/output commands if needed.349. Set env vars in Project Settings → Environment Variables (Production/Preview/Dev).3510. **Custom domain:** add in Settings → Domains. DNS: CNAME to `cname.vercel-dns.com` or A record `76.76.21.21`. SSL auto-provisioned.3637#### Netlify3811. `npm i -g netlify-cli && netlify init`. Set build command and publish directory.3912. **Redirects** in `netlify.toml`: `[[redirects]] from="/*" to="/index.html" status=200`.4013. Set env vars in Site Settings → Environment.4142### Step 3: SSL & CDN434414. All platforms auto-provision SSL (Let's Encrypt). Verify HTTPS is active.4515. **Cache headers** for hashed assets: `Cache-Control: public, max-age=31536000, immutable`.4616. **Lighthouse audit:** target Performance > 90, Accessibility > 90. Core Web Vitals: LCP < 2.5s, FID < 100ms, CLS < 0.1.4748### Step 4: Monitoring495017. **Uptime:** UptimeRobot (free, 1-5 min checks) or BetterUptime.5118. **Errors:** Sentry (free tier). Add `Sentry.init({ dsn })` in app entry.5219. **Alerts:** email on > 5 errors/hour, Slack on > 10 errors/hour.5320. **Performance:** Vercel Speed Insights or Netlify Analytics. Track load times, API latency, bundle size trends.5455### Step 5: Update & Rollback565721. **Update flow:** Pull → Install → Test → Build → Push to main → CI runs → Verify → Smoke test → Monitor 15 min.5822. **Rollback by platform:**59 - Vercel: Dashboard → Deployments → "..." → Promote to Production (30s)60 - Netlify: Dashboard → Deploys → Rollback previous61 - GitHub Pages: `git revert [hash]` → push → Actions redeploys6223. **Smoke test:** homepage loads, nav works, key flows function, no console errors, assets load, APIs respond.6364---6566## Constraints6768- NEVER deploy locally to production for team projects. Always use CI/CD.69- NEVER commit secrets. Use platform UI or encrypted secrets.70- ALWAYS test on preview before promoting to production.71- ALWAYS have a rollback plan before deploying.72- NEVER skip the post-deploy smoke test.73- Environment variables MUST be documented in `.env.example`.74- SSL MUST be active on production.75- Deploy logs MUST be checked for warnings even on successful builds.7677---7879## Examples8081### Example 1: React SPA → Vercel8283```84Project: React + TypeScript + Vite portfolio851. npm run build → dist/862. Push to GitHub main → Vercel auto-deploys873. Env vars: VITE_API_URL, VITE_CONTACT_EMAIL884. Domain: portfolio.jane.dev → CNAME cname.vercel-dns.com895. SSL auto, Lighthouse 96/98/100906. Sentry for errors, UptimeRobot 5-min pings91Rollback: Vercel dashboard → Promote previous deploy92```9394### Example 2: Docs Site → GitHub Pages9596```97Project: Astro + Tailwind documentation981. .github/workflows/deploy.yml → actions/deploy-pages992. Push main → Actions builds and deploys1003. Domain: docs.project.com → CNAME github.io1014. Enable Enforce HTTPS toggle1025. 404.html for SPA routing fallback1036. UptimeRobot 1-min checks → Slack alerts1047. Weekly Lighthouse via cron GitHub Action105Rollback: git revert [hash] → push → Actions redeploys106```