SYSTEM FOUNDATIONS · 15
Cloud / Deployment:GitHub 上的 Code 怎麼變成 Production
Deployment 是把經過驗證的 artifact 發布到 production runtime。Cloud 平台不是「神奇地讀 GitHub 就出網站」;中間仍有 checkout、install、check、build、upload、routing、smoke。
Learning outcomes
- 能區分 source repo、CI runner、artifact、production deployment。
- 能說明 build 與 deploy 是不同階段。
- 能理解 environment/secrets 不應硬寫進 source。
- 能解釋 deploy success 為什麼不等於 production success。
1. CI Runner
GitHub commit
↓
CI runner checkout
↓
install dependencies
↓
checks/tests
↓
buildRunner 是一次性的執行環境,不是 production server。
2. Artifact
src/
↓ build
dist/
index.html
app.js
styles.cssProduction 應部署你真正驗過的 output,而不是模糊地假設 source files 等於 final artifact。
3. Deploy
dist/
↓ upload
Cloud platform
↓ routing/runtime
Public URLStatic assets、serverless function、container、VM 都是不同 deployment model,但都要回答「artifact 在哪裡執行/被服務」。
4. Secrets / Environment
source code:
no privileged secret
CI / platform:
secret store
env configurationSecret 不應進 Git history。Public client config 和 privileged secret 也要依能力區分。
5. Production Smoke
deploy command PASS
↓
GET public URL
↓
status/content check
↓
production evidence平台接受 deployment 不代表 route、asset、env、API 都正常。
Project checkpoint:Request Journey Map v15
Local commit
↓ push
GitHub
↓ CI checks
Build artifact
↓ deploy
Cloud platform
↓ public URL
Production smoke
↓
User requestDebug evidence:CI 綠、production 壞
先分 artifact、environment、routing、runtime、external dependency。不要因為 CI PASS 就假設 production 一定使用同一份 config/route。
Knowledge check
- CI runner 和 production runtime 差在哪?
- artifact 是什麼?
- secret 為什麼不能 commit?
- deploy success 後為什麼仍要 smoke?