본문 바로가기
C.W.K.
Stream
Lesson 13 of 13 · published

배포 알림

~8 min · notifications, slack, alerts

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

팀에 무슨 일이 일어났는지 알려

모든 배포, 성공하든 실패하든 팀 커뮤니케이션 채널에 흔적을 남겨야 해. 감사 추적이 정말 중요해. 사건이 터지면 가장 먼저 묻는 건 '누가 언제 뭘 배포했는가'야.

채널

  • Slack — 가장 흔하게 써. Incoming webhook과 함께 slackapi/slack-github-action을 사용해. 배포 채널에 고정해둬.
  • Discord — webhook 기반이야.
  • 이메일dawidd6/action-send-mail이나 자체 SMTP를 써.
  • Telegram — bot API로 curl 호출 한 번이면 돼.
  • PagerDuty / Opsgenie — 실패 전용이고 에스컬레이션 경로에 써.
  • GitHub Deployments — 환경 범위의 작업이 이미 만들어져 있어. Deployments 탭과 PR에서 볼 수 있어.

유용한 메시지 내용

  1. 서비스 이름과 환경.
  2. 배포되는 버전이나 SHA.
  3. 실행 조건을 발동시킨 actor(사용자나 bot).
  4. 결과(성공 / 실패 / 취소).
  5. 워크플로 실행 링크.
  6. 배포된 URL 링크(검증용).

실패 메시지는 성공 메시지보다 더 크게 다뤄. 다른 채널로 보내거나, @멘션을 걸거나, 색상으로 강조해.

Code

배포 결과에 Slack 알림·yaml
  notify:
    needs: [deploy, smoke]
    if: always()
    runs-on: ubuntu-latest
    steps:
      - name: Notify Slack
        uses: slackapi/slack-github-action@v2
        with:
          webhook: ${{ secrets.SLACK_DEPLOY_WEBHOOK }}
          webhook-type: incoming-webhook
          payload: |
            {
              "text": "${{ job.status == 'success' && '✅' || '🚨' }} *${{ github.repository }}* deploy ${{ needs.smoke.result || needs.deploy.result }}\n"
                       + "Version: <https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>\n"
                       + "Actor: ${{ github.actor }}\n"
                       + "Run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|view>"
            }

External links

Exercise

워크플로 하나에 배포-result 알림을 추가해. Staging에서 의도적으로 배포를 실패시키고 실패 메시지에 SHA, actor, 실행 링크가 들어갔는지 확인해. 그다음 성공시키고 성공 메시지도 잘 나오는지 확인해.

Progress

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

댓글 0

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

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