[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-828255f6-bc2f-44a0-8f3a-cbc6edcb8b9a":3,"$fTjL97GonLn1nhC49rCzR-JdIV9xjblfi1kHp07Rsd7A":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"828255f6-bc2f-44a0-8f3a-cbc6edcb8b9a","deployment-procedures","生产部署原则和决策。安全部署工作流程、回滚策略和验证。教授思考而非脚本。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: deployment-procedures\ndescription: \"Production deployment principles and decision-making. Safe deployment workflows, rollback strategies, and verification. Teaches thinking, not scripts.\"\nrisk: critical\nsource: community\ndate_added: \"2026-02-27\"\n---\n\n# Deployment Procedures\n\n> Deployment principles and decision-making for safe production releases.\n> **Learn to THINK, not memorize scripts.**\n\n---\n\n## ⚠️ How to Use This Skill\n\nThis skill teaches **deployment principles**, not bash scripts to copy.\n\n- Every deployment is unique\n- Understand the WHY behind each step\n- Adapt procedures to your platform\n\n---\n\n## 1. Platform Selection\n\n### Decision Tree\n\n```\nWhat are you deploying?\n│\n├── Static site \u002F JAMstack\n│   └── Vercel, Netlify, Cloudflare Pages\n│\n├── Simple web app\n│   ├── Managed → Railway, Render, Fly.io\n│   └── Control → VPS + PM2\u002FDocker\n│\n├── Microservices\n│   └── Container orchestration\n│\n└── Serverless\n    └── Edge functions, Lambda\n```\n\n### Each Platform Has Different Procedures\n\n| Platform | Deployment Method |\n|----------|------------------|\n| **Vercel\u002FNetlify** | Git push, auto-deploy |\n| **Railway\u002FRender** | Git push or CLI |\n| **VPS + PM2** | SSH + manual steps |\n| **Docker** | Image push + orchestration |\n| **Kubernetes** | kubectl apply |\n\n---\n\n## 2. Pre-Deployment Principles\n\n### The 4 Verification Categories\n\n| Category | What to Check |\n|----------|--------------|\n| **Code Quality** | Tests passing, linting clean, reviewed |\n| **Build** | Production build works, no warnings |\n| **Environment** | Env vars set, secrets current |\n| **Safety** | Backup done, rollback plan ready |\n\n### Pre-Deployment Checklist\n\n- [ ] All tests passing\n- [ ] Code reviewed and approved\n- [ ] Production build successful\n- [ ] Environment variables verified\n- [ ] Database migrations ready (if any)\n- [ ] Rollback plan documented\n- [ ] Team notified\n- [ ] Monitoring ready\n\n---\n\n## 3. Deployment Workflow Principles\n\n### The 5-Phase Process\n\n```\n1. PREPARE\n   └── Verify code, build, env vars\n\n2. BACKUP\n   └── Save current state before changing\n\n3. DEPLOY\n   └── Execute with monitoring open\n\n4. VERIFY\n   └── Health check, logs, key flows\n\n5. CONFIRM or ROLLBACK\n   └── All good? Confirm. Issues? Rollback.\n```\n\n### Phase Principles\n\n| Phase | Principle |\n|-------|-----------|\n| **Prepare** | Never deploy untested code |\n| **Backup** | Can't rollback without backup |\n| **Deploy** | Watch it happen, don't walk away |\n| **Verify** | Trust but verify |\n| **Confirm** | Have rollback trigger ready |\n\n---\n\n## 4. Post-Deployment Verification\n\n### What to Verify\n\n| Check | Why |\n|-------|-----|\n| **Health endpoint** | Service is running |\n| **Error logs** | No new errors |\n| **Key user flows** | Critical features work |\n| **Performance** | Response times acceptable |\n\n### Verification Window\n\n- **First 5 minutes**: Active monitoring\n- **15 minutes**: Confirm stable\n- **1 hour**: Final verification\n- **Next day**: Review metrics\n\n---\n\n## 5. Rollback Principles\n\n### When to Rollback\n\n| Symptom | Action |\n|---------|--------|\n| Service down | Rollback immediately |\n| Critical errors | Rollback |\n| Performance >50% degraded | Consider rollback |\n| Minor issues | Fix forward if quick |\n\n### Rollback Strategy by Platform\n\n| Platform | Rollback Method |\n|----------|----------------|\n| **Vercel\u002FNetlify** | Redeploy previous commit |\n| **Railway\u002FRender** | Rollback in dashboard |\n| **VPS + PM2** | Restore backup, restart |\n| **Docker** | Previous image tag |\n| **K8s** | kubectl rollout undo |\n\n### Rollback Principles\n\n1. **Speed over perfection**: Rollback first, debug later\n2. **Don't compound errors**: One rollback, not multiple changes\n3. **Communicate**: Tell team what happened\n4. **Post-mortem**: Understand why after stable\n\n---\n\n## 6. Zero-Downtime Deployment\n\n### Strategies\n\n| Strategy | How It Works |\n|----------|--------------|\n| **Rolling** | Replace instances one by one |\n| **Blue-Green** | Switch traffic between environments |\n| **Canary** | Gradual traffic shift |\n\n### Selection Principles\n\n| Scenario | Strategy |\n|----------|----------|\n| Standard release | Rolling |\n| High-risk change | Blue-green (easy rollback) |\n| Need validation | Canary (test with real traffic) |\n\n---\n\n## 7. Emergency Procedures\n\n### Service Down Priority\n\n1. **Assess**: What's the symptom?\n2. **Quick fix**: Restart if unclear\n3. **Rollback**: If restart doesn't help\n4. **Investigate**: After stable\n\n### Investigation Order\n\n| Check | Common Issues |\n|-------|--------------|\n| **Logs** | Errors, exceptions |\n| **Resources** | Disk full, memory |\n| **Network** | DNS, firewall |\n| **Dependencies** | Database, APIs |\n\n---\n\n## 8. Anti-Patterns\n\n| ❌ Don't | ✅ Do |\n|----------|-------|\n| Deploy on Friday | Deploy early in week |\n| Rush deployment | Follow the process |\n| Skip staging | Always test first |\n| Deploy without backup | Backup before deploy |\n| Walk away after deploy | Monitor for 15+ min |\n| Multiple changes at once | One change at a time |\n\n---\n\n## 9. Decision Checklist\n\nBefore deploying:\n\n- [ ] **Platform-appropriate procedure?**\n- [ ] **Backup strategy ready?**\n- [ ] **Rollback plan documented?**\n- [ ] **Monitoring configured?**\n- [ ] **Team notified?**\n- [ ] **Time to monitor after?**\n\n---\n\n## 10. Best Practices\n\n1. **Small, frequent deploys** over big releases\n2. **Feature flags** for risky changes\n3. **Automate** repetitive steps\n4. **Document** every deployment\n5. **Review** what went wrong after issues\n6. **Test rollback** before you need it\n\n---\n\n> **Remember:** Every deployment is a risk. Minimize risk through preparation, not speed.\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,129,1282,"2026-05-16 13:15:05",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"04fa7de7-cf75-4523-9970-d44d757689bd","1.0.0","deployment-procedures.zip",2818,"uploads\u002Fskills\u002F828255f6-bc2f-44a0-8f3a-cbc6edcb8b9a\u002Fdeployment-procedures.zip","c54fdc7bd74ce810e7b4b0d3ca5c6e810b03f1ef238d840d340faf2e5f7c4e7e","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":6152}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]