no message
This commit is contained in:
parent
62f803f3e3
commit
8f652039a9
1 changed files with 36 additions and 16 deletions
52
.github/workflows/release.yaml
vendored
52
.github/workflows/release.yaml
vendored
|
|
@ -11,6 +11,7 @@ env:
|
||||||
DEPLOY_HOST: frappet.com
|
DEPLOY_HOST: frappet.com
|
||||||
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
||||||
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-org
|
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-org
|
||||||
|
DISCORD_WEBHOOK: https://discord.com/api/webhooks/1314422269245657098/mOzvDZbIC9YY2ydxBeUPqSJ6dxSiWFHLSY_Stxah92zio0csg4J49K2Pg-0B5AUea3WP
|
||||||
jobs:
|
jobs:
|
||||||
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
|
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
|
||||||
release-test:
|
release-test:
|
||||||
|
|
@ -67,21 +68,40 @@ jobs:
|
||||||
docker compose pull
|
docker compose pull
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
- name: Notify Discord Success
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
run: |
|
||||||
access_token: ${{ secrets.TOKEN_LINE }}
|
curl -H "Content-Type: application/json" \
|
||||||
message: |
|
-X POST \
|
||||||
-Success✅✅✅
|
-d '{
|
||||||
Image: ${{env.IMAGE_NAME}}
|
"embeds": [{
|
||||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
"title": "✅ Deployment Success!",
|
||||||
By: ${{github.actor}}
|
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
"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()
|
if: failure()
|
||||||
with:
|
run: |
|
||||||
access_token: ${{ secrets.TOKEN_LINE }}
|
curl -H "Content-Type: application/json" \
|
||||||
message: |
|
-X POST \
|
||||||
-Failure❌❌❌
|
-d '{
|
||||||
Image: ${{env.IMAGE_NAME}}
|
"embeds": [{
|
||||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
"title": "❌ Deployment Failed!",
|
||||||
By: ${{github.actor}}
|
"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 }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue