refactor: streamline Telegram deployment notifications by replacing the dedicated notification step with an inline curl command and updating the message content.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Moh Dzulfikri Maulana
2026-03-10 13:32:50 +07:00
parent 3a41b7dd5c
commit ed985bb930

View File

@@ -37,43 +37,11 @@ steps:
- docker compose up -d --remove-orphans
- docker image prune -f
- >
curl -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage"
-d "chat_id=${TELEGRAM_CHAT_ID}"
-d "message_thread_id=8"
-d "parse_mode=HTML"
-d "text=🚀 <b>Deployment Success!</b>%0A<b>Project:</b> fullstack-portfolio%0A<b>Status:</b> Finished"
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage"
-d "chat_id=${TELEGRAM_CHAT_ID}"
-d "message_thread_id=8"
-d "parse_mode=HTML"
-d "text= <b>Deployment Success!</b>%0A<b>Project:</b> portfolio%0A<b>Status:</b> Finished"
when:
branch: master
event: push
# 3.Telegram Notification
notify-telegram:
image: appleboy/drone-telegram:1.3.9
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_chat_id
message_thread_id: 8
format: html
message: |
{{#success build.status}}
✅ <b>Deployment SUCCESS</b>
{{else}}
❌ <b>Deployment FAILED</b>
{{/success}}
<b>📦 Project:</b> <code>{{ repo.name }}</code>
<b>📝 Commit:</b>
<i>{{ commit.message }}</i>
<b>👤 Author:</b> {{ commit.author }}
<b>🛠 Build Details:</b>
⏱ <b>Duration:</b> {{ build.duration }}s
🔗 <a href="{{ build.link }}">View Full Logs</a>
when:
- event: [push]
branch: master
status: [ success, failure ]