C.W.K.
Stream
Lesson 13 of 13 · published

Deployment Notifications

~8 min · notifications, slack, alerts

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

Tell the team what happened

Every deploy — successful or not — should leave a footprint in the team's communication channel. The audit trail matters: 'who shipped what when' is the first question after every incident.

Channels

  • Slack — most common. Use slackapi/slack-github-action with an incoming webhook. Pin the deploy channel.
  • Discord — webhook-based.
  • Emaildawidd6/action-send-mail or your own SMTP.
  • Telegram — bot API; one curl call.
  • PagerDuty / Opsgenie — for failures only, escalation paths.
  • GitHub Deployments — every environment-scoped job already creates one. Visible in the Deployments tab and PR.

What a useful message contains

  1. Service name + environment.
  2. Version / SHA being deployed.
  3. Triggering actor (user or bot).
  4. Result (success / failure / cancelled).
  5. Link to the workflow run.
  6. Link to the deployed URL (for verifications).

Failure messages should be louder than success messages — different channel, @mention, or color.

Code

Slack notify on deploy result·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

Add a deploy-result notification to one workflow. Deliberately fail a deploy in staging and verify the failure message includes the SHA, actor, and a link to the run. Then succeed and verify the success message also fires.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.