본문으로 건너뛰기
cccskills
무료GitHub에 공개

deployment-infrastructure

Deploy to Vercel/Cloudflare, manage environment variables, troubleshoot builds, and handle rollbacks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구VercelCloudflare
설치 방법 보기

포함된 파일(1)

  • SKILL.md4.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Deployment & Infrastructure

When to use this skill

  • Deploying the portfolio to Vercel or Cloudflare
  • Troubleshooting failed builds or deployments
  • Managing environment variables across environments
  • Rolling back to a previous deployment
  • Configuring domains, SSL, or edge functions
  • Debugging build-time vs runtime errors

Workflow

1. Pre-deployment checks

Run the full verification suite before any deployment:

npx tsc --noEmit          # TypeScript must pass
npm run lint               # ESLint must pass
npm run test -- --run      # Tests must pass
npm run doctor             # React-doctor must be 100/100
npm run build              # Build must succeed

If any step fails, fix it before deploying. Never deploy broken code.

2. Vercel deployment

Local preview (production-like):

npm run build && npm run start

Vercel CLI deploy:

npx vercel --prod          # Production deployment
npx vercel                 # Preview deployment (branch)

Vercel environment variables:

VariableEnvironmentRequired
NEXT_PUBLIC_SANITY_PROJECT_IDAllYes
NEXT_PUBLIC_SANITY_DATASETAllYes
SANITY_API_READ_TOKENAllYes
SANITY_REVALIDATE_SECRETAllYes
NEXT_PUBLIC_UMAMI_WEBSITE_IDProductionNo
NEXT_PUBLIC_UMAMI_SCRIPT_URLProductionNo
NEXT_PUBLIC_UMAMI_HOST_URLProductionNo

Check env vars are set:

npx vercel env ls

3. Cloudflare deployment

The repo uses opennextjs-cloudflare for Cloudflare compatibility:

npm run cloudflare:build     # Build for Cloudflare
npm run cloudflare:dev       # Local Cloudflare dev
npm run cloudflare:deploy    # Deploy to Cloudflare

Cloudflare-specific notes:

  • output: 'standalone' is disabled on Windows (isWindows check in next.config.js)
  • Edge runtime is NOT used -- the repo uses Node.js runtime for API routes
  • wrangler.toml configures Workers bindings

4. Build troubleshooting

Common build errors:

ErrorCauseFix
Module not foundMissing dependencynpm install
Type errorTypeScript strict modeFix the type error in the source
Hydration mismatchServer/client HTML differCheck useEffect guards, mounted state
Circular dependencyImport cycleRefactor to break the cycle
ENOMEMOut of memoryIncrease Node memory: NODE_OPTIONS="--max-old-space-size=4096"

Build analysis:

ANALYZE=true npm run build   # Bundle analyzer (if configured)

5. Rollback procedure

Vercel rollback:

npx vercel rollback          # Roll back to previous deployment
npx vercel rollback <url>    # Roll back to specific deployment

Git rollback:

git log --oneline -10        # Find the commit to roll back to
git revert <commit-hash>     # Create a revert commit
git push                     # Trigger redeployment

Emergency: force deploy last known good:

git checkout <good-commit> -- .
git commit -m "chore: emergency rollback to <good-commit>"
git push

6. Domain and SSL

Vercel manages SSL automatically. For custom domains:

npx vercel domains add <domain>

Verify DNS records point to Vercel's nameservers or use CNAME to cname.vercel-dns.com.

Common mistakes

  • Deploying without running npm run build locally first
  • Forgetting to set environment variables in the Vercel dashboard
  • Using console.log in production code (use reportWebVitals instead)
  • Not testing the production build locally before pushing

Delivery checks

  • npm run build succeeds locally
  • All environment variables are set in the target environment
  • Production URL loads correctly
  • No console errors in browser DevTools
  • Service worker registers correctly (if applicable)
  • Sanity data loads and revalidation works
  • OG images and meta tags render correctly

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit and fix accessibility issues across the portfolio to ensure WCAG 2.1 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new blog post document in the Sanity studio. Use when the user wants to write a blog post, publish an article, or schedule a future post.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new certification document in the Sanity studio. Use when the user wants to add a credential, certificate, or professional accreditation to the Certifications collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Adds a new skill MD file to the studio's skills collection. Use when the user wants to author a new step-by-step recipe for the studio's in-app Skills tool or the .agents mirror.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new project document in the Sanity studio. Use when the user wants to add a new portfolio project, a case study, or a work sample to the Projects collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new experience document in the Sanity studio. Use when the user wants to add a job, role, internship, or work history entry to the Experience collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

PP-Namias의 스킬 모두 보기

이 스킬의 문제 신고