edit build

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2024-12-06 09:09:43 +07:00
parent d877d0fae2
commit e295c13ba3
2 changed files with 42 additions and 26 deletions

View file

@ -10,6 +10,8 @@ env:
IMAGE_NAME: ehr/bma-ehr-log-backup
DEPLOY_HOST: 49.0.91.80
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-log-backup
DISCORD_WEBHOOK: https://discord.com/api/webhooks/1313895135121248377/ph4LEfzvrNKyPKouCfHkKx73E323sAc--f3aIM2N0pvS-lQaGdBOg-yHxSNNFxfvjob7
jobs:
release:
runs-on: ubuntu-latest
@ -64,21 +66,40 @@ jobs:
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- uses: snow-actions/line-notify@v1.1.0
- name: Notify Discord Success
if: success()
with:
access_token: ${{ secrets.TOKEN_LINE }}
message: |
Image: ${{ env.IMAGE_NAME }}
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
By: ${{github.actor}}
- uses: snow-actions/line-notify@v1.1.0
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "✅ Deployment Success!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
"color": 3066993,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/success-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ env.DISCORD_WEBHOOK }}
- name: Notify Discord Failure
if: failure()
with:
access_token: ${{ secrets.TOKEN_LINE }}
message: |
Image: ${{ env.IMAGE_NAME }}
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
By: ${{github.actor}}
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "❌ Deployment Failed!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
"color": 15158332,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/failure-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ env.DISCORD_WEBHOOK }}