internal-comms
Write internal communications following company formats, including status reports, leadership updates, and newsletters.
ANanthropics/skills203k3,333 new stars in the last 7 days
Vercel 部署方法论,使用 vercel CLI 部署前端和全栈应用(Next.js、React、Vue、静态站点)
npm i -g vercelvercel login(需要用户交互完成登录)package.json# 检查是否已有 vercel.json
ls vercel.json 2>/dev/null && echo "exists" || echo "missing"
{
"framework": "nextjs",
"buildCommand": "npm run build",
"outputDirectory": ".next",
"installCommand": "npm install",
"devCommand": "npm run dev",
"regions": ["iad1"],
"env": {
"NODE_ENV": "production"
}
}
框架自动检测:Vercel 会自动识别框架,通常无需手动配置 framework。
# 首次部署(交互式,需要用户确认项目设置)
vercel
# 非交互式部署(CI 环境)
vercel --yes --prod
首次部署输出示例:
Vercel CLI 37.0.0
🔗 Linked to username/project (created .vercel)
🔍 Inspect: https://vercel.com/username/project/xxx
✅ Production: https://project-xxx.vercel.app
# 预览部署(staging)
vercel
# 生产部署
vercel --prod
# 添加环境变量
vercel env add DATABASE_URL production
# 列出环境变量
vercel env ls
# 删除环境变量
vercel env rm DATABASE_URL production
# 拉取环境变量到本地 .env
vercel env pull .env.local
# 添加自定义域名
vercel domains add example.com
# 列出域名
vercel domains ls
name: Deploy to Vercel
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
vercel-args: "--prod"
需要的 Secrets:
VERCEL_TOKEN:Vercel Personal Access Token(Settings → Tokens)ORG_ID:Vercel 团队/个人 IDPROJECT_ID:Vercel 项目 ID| 项目类型 | vercel.json 配置 | 说明 |
|---|---|---|
| Next.js | 自动检测 | 无需额外配置 |
| Vite (React/Vue) | "outputDirectory": "dist" | 需指定构建输出 |
| 静态 HTML | 无需配置 | 直接部署根目录 |
| SvelteKit | 自动检测 | 使用 adapter-vercel |
vercel.json 配置正确(buildCommand、outputDirectory)vercel env add)npm run build)Write internal communications following company formats, including status reports, leadership updates, and newsletters.
ANanthropics/skills203k3,333 new stars in the last 7 days
GAgarrytan/gstack143k636 new stars in the last 7 days
ADaddyosmani/agent-skills122k1,627 new stars in the last 7 days
A pre-launch checklist covering monitoring, staged rollouts and rollback plans.
ADaddyosmani/agent-skills122k1,627 new stars in the last 7 days
PApaperclipai/paperclip119k2,120 new stars in the last 7 days
RUruvnet/RuView106k693 new stars in the last 7 days