C.W.K.
Stream
Lesson 05 of 14 · published

Concurrency

~10 min · concurrency, cancel, groups

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

오래된 commit 에 분 낭비 그만

5 분에 10 번 push 하면 기본 동작은 CI 10 개 병렬 run. 시작 순간 9 개 obsolete. concurrency:그룹 선언; 그룹 당 한 run 만 활성, 활성 그룹에 새 run 시작 시 무슨 일 할지 선택.

설정 두 개

  • group: — 그룹 식별 string template. 흔한: ${{ github.workflow }}-${{ github.ref }} (workflow 당 branch 당 한 run).
  • cancel-in-progress: — true 면 새 거 시작 위해 도는 거 취소; false 면 새 거 큐에.

옳은 그룹 선택

  • PR feedbackgithub.ref 그룹; cancel-in-progress true. 새 push 가 옛 run 무효화.
  • Deploy — environment 이름 그룹; cancel-in-progress false. 같은 env 의 두 deploy 직렬화.
  • Releasegithub.workflow 그룹; cancel-in-progress false. Release 큐, 겹침 없음.

Code

Concurrency 전략 세 가지·yaml
# 1) PR feedback — cancel old runs
concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

# 2) Deploy — serialize, no cancel (mid-deploy cancellation is dangerous)
concurrency:
  group: deploy-${{ github.event.inputs.environment || 'staging' }}
  cancel-in-progress: false

# 3) Release — single global queue
concurrency:
  group: release
  cancel-in-progress: false

External links

Exercise

CI workflow 에 cancel-in-progress 와 함께 concurrency 추가, deploy workflow 는 직렬-only. CI 에 빠르게 두 번 push; 첫 번째 취소 확인. Deploy 두 번 trigger; 두 번째 큐 확인.

Progress

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

댓글 0

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

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