From 3397cb4396b5aeae93ce56f7e0cd52828788bd53 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat <162551568+Methapon-Frappet@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:49:29 +0700 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 52 +++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2842baca..e252340c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,22 +53,40 @@ jobs: platforms: linux/amd64 push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - - - uses: snow-actions/line-notify@v1.1.0 + - name: Notify Discord Success if: success() - with: - access_token: ${{ secrets.TOKEN_LINE }} - message: | - -Success✅✅✅ - 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)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure if: failure() - with: - access_token: ${{ secrets.TOKEN_LINE }} - message: | - -Failure❌❌❌ - 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)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} +