WEBBOOK CHAPTER

CI/CD, 서버실에서 클라우드까지: 16장. GitHub environment를 운영 승인 경계로 쓴다

16장. GitHub environment를 운영 승인 경계로 쓴다

Deployment environments는 required reviewer, branch restriction, protection rule, environment secret을 제공한다. production job이 environment를 선언해야 gate와 deployment history가 연결된다.


deploy-production:
  environment: production
  permissions:
    contents: read
    id-token: write

approval 전 job이 cloud credential을 얻거나 artifact를 바꾸지 않게 stage를 분리한다. approver에게 digest, diff, tests, risk, rollback, canary 기준을 보여 준다. “approve” 버튼이 evidence를 찾는 작업이 되면 형식적 승인으로 변한다.

self-hosted runner는 private network 접근에 유용하지만 persistent compromise 위험이 있다. public repository나 fork code를 privileged runner에 보내지 않는다. ephemeral isolation, egress, update, image cleanup, runner group을 운영한다.