This commit is contained in:
parent
957e4c65c0
commit
9a4f5b5d27
3 changed files with 54 additions and 2 deletions
|
|
@ -48,3 +48,23 @@ jobs:
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
tags: ${{ env.CONTAINER_IMAGE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
|
tags: ${{ env.CONTAINER_IMAGE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
|
||||||
push: true
|
push: true
|
||||||
|
- name: Discord Notification
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
||||||
|
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d '{
|
||||||
|
"embeds": [{
|
||||||
|
"title": $STATUS,
|
||||||
|
"description": "**Build:**\n- Image: `${{env.CONTAINER_IMAGE_NAME}}`\n- Version: `${{ env.IMAGE_VERSION }}`\n- Deployed by: `${{gitea.actor}}`",
|
||||||
|
"color": $COLOR,
|
||||||
|
"footer": {
|
||||||
|
"text": "Release Notification",
|
||||||
|
"icon_url": "https://example.com/success-icon.png"
|
||||||
|
},
|
||||||
|
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||||
|
}]
|
||||||
|
}' \
|
||||||
|
${{ env.DISCORD_WEBHOOK }}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,18 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
||||||
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
||||||
curl -H "Content-Type: application/json" -X POST \
|
curl -H "Content-Type: application/json" \
|
||||||
-d "{\"embeds\":[{\"title\":\"$STATUS\",\"description\":\"Build & Deploy Image: \`${{env.CONTAINER_IMAGE_NAME}}:${{env.IMAGE_VERSION}}\`\nBy: \`${{gitea.actor}}\`\",\"color\":$COLOR}]}" \
|
-X POST \
|
||||||
|
-d '{
|
||||||
|
"embeds": [{
|
||||||
|
"title": $STATUS,
|
||||||
|
"description": "**Build & Deploy:**\n- Image: `${{env.CONTAINER_IMAGE_NAME}}`\n- Version: `${{ env.IMAGE_VERSION }}`\n- Deployed by: `${{gitea.actor}}`",
|
||||||
|
"color": $COLOR,
|
||||||
|
"footer": {
|
||||||
|
"text": "Release Notification",
|
||||||
|
"icon_url": "https://example.com/success-icon.png"
|
||||||
|
},
|
||||||
|
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||||
|
}]
|
||||||
|
}' \
|
||||||
${{ env.DISCORD_WEBHOOK }}
|
${{ env.DISCORD_WEBHOOK }}
|
||||||
|
|
|
||||||
|
|
@ -27,3 +27,23 @@ jobs:
|
||||||
cd ~/repo
|
cd ~/repo
|
||||||
./replace-env.sh APP_USER "${{ inputs.version }}"
|
./replace-env.sh APP_USER "${{ inputs.version }}"
|
||||||
./deploy.sh hrms-user
|
./deploy.sh hrms-user
|
||||||
|
- name: Discord Notification
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
STATUS="${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}"
|
||||||
|
COLOR="${{ job.status == 'success' && '3066993' || '15158332' }}"
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d '{
|
||||||
|
"embeds": [{
|
||||||
|
"title": $STATUS,
|
||||||
|
"description": "**Deploy APP_USER**\n- Version: `${{ env.IMAGE_VERSION }}`\n- Deployed by: `${{gitea.actor}}`",
|
||||||
|
"color": $COLOR,
|
||||||
|
"footer": {
|
||||||
|
"text": "Release Notification",
|
||||||
|
"icon_url": "https://example.com/success-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