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
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -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 ]
|
||||
Reference in New Issue
Block a user