Add Slack notifications to CI workflows

Slack notifications for success and failure have been added to the k3d, kind, kustomize, microk8s, and pr-description GitHub Actions workflows. This improves visibility of deployment and PR automation results by sending status updates to a configured Slack channel.
This commit is contained in:
Cédric Verstraeten
2025-11-27 10:21:20 +01:00
parent 3162d1f915
commit 5786c5073e
5 changed files with 85 additions and 4 deletions

View File

@@ -127,4 +127,20 @@ jobs:
kubectl wait --for=condition=available deployment/pipe-sequence -n kerberos-hub --timeout=300s
kubectl wait --for=condition=available deployment/pipe-sprite -n kerberos-hub --timeout=300s
kubectl wait --for=condition=available deployment/pipe-throttler -n kerberos-hub --timeout=300s
kubectl get pods -A -o wide
kubectl get pods -A -o wide
- name: Send Slack Notification on Success
if: success()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"✅ K3d Deployment Successful! :rocket:\n*OS*: ${{ matrix.os }}\n*K3d Version*: ${{ matrix.k3d }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\"
}" $SLACK_WEBHOOK_URL
- name: Send Slack Notification on Failure
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"❌ K3d Deployment Failed! :x:\n*OS*: ${{ matrix.os }}\n*K3d Version*: ${{ matrix.k3d }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\n*Run URL*: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}" $SLACK_WEBHOOK_URL

View File

@@ -123,4 +123,20 @@ jobs:
kubectl wait --for=condition=available deployment/pipe-sequence -n kerberos-hub --timeout=300s
kubectl wait --for=condition=available deployment/pipe-sprite -n kerberos-hub --timeout=300s
kubectl wait --for=condition=available deployment/pipe-throttler -n kerberos-hub --timeout=300s
kubectl get pods -A -o wide
kubectl get pods -A -o wide
- name: Send Slack Notification on Success
if: success()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"✅ Kind Deployment Successful! :rocket:\n*OS*: ${{ matrix.os }}\n*Kind Version*: ${{ matrix.kind }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\"
}" $SLACK_WEBHOOK_URL
- name: Send Slack Notification on Failure
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"❌ Kind Deployment Failed! :x:\n*OS*: ${{ matrix.os }}\n*Kind Version*: ${{ matrix.kind }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\n*Run URL*: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}" $SLACK_WEBHOOK_URL

View File

@@ -28,4 +28,20 @@ jobs:
kubectl get pods -A -o wide
kubectl get sc
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v2
- name: Send Slack Notification on Success
if: success()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"✅ Kustomize Deployment Successful! :rocket:\n*OS*: ${{ matrix.os }}\n*Kind Version*: ${{ matrix.kind }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\"
}" $SLACK_WEBHOOK_URL
- name: Send Slack Notification on Failure
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"❌ Kustomize Deployment Failed! :x:\n*OS*: ${{ matrix.os }}\n*Kind Version*: ${{ matrix.kind }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\n*Run URL*: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}" $SLACK_WEBHOOK_URL

View File

@@ -117,4 +117,21 @@ jobs:
kubectl wait --for=condition=available deployment/pipe-sequence -n kerberos-hub --timeout=300s
kubectl wait --for=condition=available deployment/pipe-sprite -n kerberos-hub --timeout=300s
kubectl wait --for=condition=available deployment/pipe-throttler -n kerberos-hub --timeout=300s
kubectl get pods -A -o wide
kubectl get pods -A -o wide
- name: Send Slack Notification on Success
if: success()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"✅ MicroK8s Deployment Successful! :rocket:\n*OS*: ${{ matrix.os }}\n*MicroK8s Version*: ${{ matrix.microk8s }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\"
}" $SLACK_WEBHOOK_URL
- name: Send Slack Notification on Failure
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"❌ MicroK8s Deployment Failed! :x:\n*OS*: ${{ matrix.os }}\n*MicroK8s Version*: ${{ matrix.microk8s }}\n*Workflow*: ${{ github.workflow }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\n*Run URL*: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}" $SLACK_WEBHOOK_URL

View File

@@ -17,3 +17,19 @@ jobs:
azure_openai_endpoint: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
azure_openai_version: ${{ secrets.AZURE_OPENAI_VERSION }}
overwrite_description: true
- name: Send Slack Notification on Success
if: success()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"✅ PR Description Auto-fill Successful! :robot_face:\n*Workflow*: ${{ github.workflow }}\n*PR*: ${{ github.event.pull_request.title }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\"
}" $SLACK_WEBHOOK_URL
- name: Send Slack Notification on Failure
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data "{
\"text\": \"❌ PR Description Auto-fill Failed! :x:\n*Workflow*: ${{ github.workflow }}\n*PR*: ${{ github.event.pull_request.title }}\n*Triggered by*: ${{ github.actor }}\n*Repository*: ${{ github.repository }}\n*Run URL*: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"
}" $SLACK_WEBHOOK_URL