add noti
All checks were successful
Build / build (push) Successful in 1m39s

This commit is contained in:
Warunee Tamkoo 2025-09-16 13:30:24 +07:00
parent 5c0f8877a4
commit 643b6903d9

View file

@ -13,6 +13,7 @@ env:
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}
IMAGE_VERSION: build
DISCORD_WEBHOOK: ${{ vars.DISCORD_WEBHOOK }}
jobs:
build:
@ -59,3 +60,24 @@ jobs:
./replace-env.sh API_CHECKIN "${{ env.IMAGE_VERSION }}"
./deploy.sh hrms-api-checkin
- name: Discord Notification
if: always()
run: |
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$STATUS\",
\"description\": \"**Build & Deploy**\\n- Image: \`${{ env.CONTAINER_IMAGE_NAME }}\`\\n- Version: \`${{ env.IMAGE_VERSION }}\`\\n- By: \`${{ github.actor }}\`\",
\"color\": $COLOR,
\"footer\": {
\"text\": \"Release Notification\",
\"icon_url\": \"https://example.com/success-icon.png\"
},
\"timestamp\": \"$TIMESTAMP\"
}]
}" \
${{ env.DISCORD_WEBHOOK }}