回顾与练习
关键要点
- 基础设施是一架五级的梯子 — 静态托管、Serverless、PaaS、托管容器,以及裸 VM — 你应当选择能完成任务的最简单的那一级。
- 优先选择托管服务:把运维(服务器、补丁、扩缩容、备份)外包出去,把理解留在自己手里。
- 让 AI 来写部署配置和 CI 工作流,但在信任之前先读一遍。
- “托管”不是“魔法” — 你的数据、密钥、账单和理解,依然是你的责任。
- 在上线之前设好支出上限、确认 HTTPS,并知道如何回滚。
动手试试
拿一个你已有的小项目(哪怕只是一个 HTML 页面)部署到静态托管上。然后让 AI 生成一个每次 push 都重新部署的 GitHub Actions 工作流,逐行读懂生成的 YAML,并确认你能在托管商的控制台里找到“回滚到上一次部署”的按钮。
I have a static site in this repo. Walk me through deploying it to a
free static host, then generate a GitHub Actions workflow that
rebuilds and redeploys on every push to main. Explain each step of
the YAML, and tell me where in the dashboard I roll back a bad deploy.