C.W.K.
Stream
Lesson 06 of 12 · published

Environment 보호 규칙

~11 min · protection, approval, branch

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Deploy 둘레의 gate

Environment 는 어느 job 이 그걸 타겟하기 전에 gate 요구할 수 있어. Settings → Environments → <name> 아래 설정.

Required reviewers

  • 최대 6 명 사용자 또는 팀.
  • Job 일시정지; reviewer 가 'Review pending deployments' 버튼 봄.
  • Reviewer 는 run trigger 한 사람이면 안 됨 (설정 가능).

Wait timer

  • 승인과 실행 사이 지연 강제 (0-30일).
  • Cooling 기간, batch deploy, 업무 시간 창에 사용.

Deployment branch policy

  • Deploy 를 특정 branch 로 제한 (보통 main 만).
  • 또는 특정 tag (release 위해 v*.*.*).
  • 이거 없으면 feature branch 가 YAML 한 줄 바꿔 prod 에 deploy 가능.

Custom deployment protection rules (Beta)

  • Deploy 에 투표하는 앱: 변경 관리 티켓, observability budget 등.
  • Gate 가 GitHub 외 데이터 필요할 때 유용.

Code

Rule 가진 environment 에 pin 된 job·yaml
  deploy-prod:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: production
      url: https://www.example.com
    # required reviewers + branch policy live in repo Settings → Environments
    # The YAML just opts into them by naming the environment.
    steps:
      - uses: actions/checkout@v4
      - run: ./deploy.sh prod

External links

Exercise

통제하는 실제 production environment 에서 설정: required reviewer (최소 본인), main 만 branch 정책, 5 분 wait timer. main 에서 deploy trigger 하고 gate 발화 확인.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.