Files
fullstack-portfolio/.woodpecker.yml
Moh Dzulfikri Maulana 3f559b37a6
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: Add dedicated Telegram notification step for build status and remove inline curl notification from deploy step.
2026-03-10 13:58:54 +07:00

68 lines
1.8 KiB
YAML

steps:
# 1. Build & Push Image
build-and-push:
image: plugins/docker
settings:
registry: git.exavolt.web.id
repo: git.exavolt.web.id/fikri/fullstack-portfolio
dockerfile: Dockerfile
use_cache: true
purge: false
username:
from_secret: gitea_user
password:
from_secret: gitea_token
when:
branch: master
event: push
# 2. Deploy via SSH
deploy:
image: appleboy/drone-ssh
settings:
host: 103.197.190.44
username: exavolt
port: 22
key:
from_secret: ssh_key
envs: [ gitea_user, gitea_token ]
gitea_user:
from_secret: gitea_user
gitea_token:
from_secret: gitea_token
script:
- cd ~/projects/fikri-fullstack-portfolio
- echo $gitea_token | docker login git.exavolt.web.id -u $gitea_user --password-stdin
- docker compose pull
- docker compose up -d --remove-orphans
- docker image prune -f
when:
branch: master
event: push
# 3. Notification (Jalan saat sukses maupun gagal)
notify-telegram:
image: appleboy/drone-telegram
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>🌿 Branch:</b> <code>{{ build.branch }}</code>
<b>📝 Commit:</b> <i>{{ commit.message }}</i>
🔗 <a href="{{ build.link }}">Lihat Detail Log</a>
when:
branch: master
event: push
status: [ success, failure ] # Kunci agar notifikasi tetap terkirim saat error