All checks were successful
continuous-integration/drone/push Build is passing
- 添加自定义消息模板,限制消息长度为 200 字符 - 简化通知格式,只保留关键信息 - 避免因过长的 commit message 导致 webhook 请求失败
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: deploy
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host:
|
|
- 206.237.26.184
|
|
username: ching
|
|
key:
|
|
from_secret: ssh_key
|
|
passphrase:
|
|
from_secret: ssh_passphrase
|
|
port: 33740
|
|
command_timeout: 2m
|
|
script:
|
|
- echo "Deploying dota2-match-calendar"
|
|
- cd /root/develop/dota2-match-calendar
|
|
- echo "Pulling latest changes"
|
|
- git pull --rebase --autostash
|
|
- echo "Deployment completed"
|
|
|
|
- name: discord notification
|
|
image: appleboy/drone-discord
|
|
settings:
|
|
webhook_id:
|
|
from_secret: discord_webhook_id
|
|
webhook_token:
|
|
from_secret: discord_webhook_token
|
|
username: Drone CI
|
|
avatar_url: https://github.com/drone.png
|
|
message: |
|
|
{{#success build.status}}
|
|
✅ **Build #{{build.number}}** succeeded
|
|
{{else}}
|
|
❌ **Build #{{build.number}}** failed
|
|
{{/success}}
|
|
**Repo:** {{repo.name}}
|
|
**Branch:** {{build.branch}}
|
|
**Commit:** `{{truncate build.commit 8}}`
|
|
**Author:** {{build.author}}
|
|
**Message:** {{truncate build.message 200}}
|
|
when:
|
|
status: [success, failure] |