Build once, deploy many: artifact (Docker image, jar, zip) build 1 lần ở stage CI, promote qua các môi trường (dev → staging → prod) — không bao giờ rebuild từ source ở mỗi môi trường. Tại sao immutable: rebuild ở mỗi env risk subtle drift (npm install cùng package.json nhưng khác lockfile resolution, base image cập nhật lén).
- Image tag bằng commit SHA hoặc semver, không bao giờ overwrite
latestcho production. Semantic versioning (semver):MAJOR.MINOR.PATCH— MAJOR khi breaking, MINOR cho feature mới backward-compat, PATCH cho bug fix. - Pre-release:
1.2.0-rc.1,2.0.0-beta.3. - Automated tooling:
semantic-release(commit message conventionfeat:,fix:,BREAKING CHANGE:→ tự bump version + tạo changelog + tag Git + publish npm). Container image tag strategy: 3 tag cùng lúc —myapp:1.4.2(semver),myapp:1.4.2-a3f8c9(semver + commit SHA cho traceability),myapp:latest(chỉ cho dev/staging, không prod). Artifact registry: GitHub Container Registry, AWS ECR, Google Artifact Registry — lưu image với retention policy (xóa image > 30 ngày trừ tagged release). SBOM (Software Bill of Materials): generate khi build (syfthoặccosign), lưu cùng artifact để audit compliance và detect vulnerable dependency sau publish.