Skip to content

Commit

Permalink
add send noti to telegram group
Browse files Browse the repository at this point in the history
  • Loading branch information
dongitran committed Nov 27, 2023
1 parent 32762d2 commit 1589ae0
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/deploy-kubernetes-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,38 @@ jobs:
- name: Deploy to Kubernetes
run: |
kubectl apply -f deployment.yaml
kubectl apply -f deployment.yaml
send-notification-successful:
needs: deploy
runs-on: ubuntu-latest
if: ${{ success() && needs.deploy.result == 'success' }}
steps:
- name: Send Telegram Notification
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: "${{ secrets.TELEGRAM_GROUP_DEPLOYMENTS }}"
run: |
curl -X POST \
https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage \
-d chat_id=${TELEGRAM_CHAT_ID} \
-d text="🎉 <b>Cloud Run CI/CD Template</b> Deployment was successful!
Your amazing tool is now available for everyone! 🚀✨" \
-d parse_mode=HTML
send-notification-failed:
needs: deploy
runs-on: ubuntu-latest
if: ${{ failure() && needs.deploy.result == 'failure' }}
steps:
- name: Send Telegram Notification
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: "${{ secrets.TELEGRAM_GROUP_DEPLOYMENTS }}"
run: |
curl -X POST \
https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage \
-d chat_id=${TELEGRAM_CHAT_ID} \
-d text="❌ Oh no! <b>Cloud Run CI/CD Template</b> Deployment failed!
There might be something wrong with the process.
Please check it out! 🛠️🔍" \
-d parse_mode=HTML

0 comments on commit 1589ae0

Please sign in to comment.