feat: add discord noti to gitea action
This commit is contained in:
parent
64e53fcdaa
commit
a4850df120
1 changed files with 36 additions and 2 deletions
38
.github/workflows/gitea-local.yaml
vendored
38
.github/workflows/gitea-local.yaml
vendored
|
|
@ -11,7 +11,7 @@ env:
|
||||||
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
|
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
|
||||||
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
|
REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
|
||||||
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
|
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
|
||||||
|
CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}/${{ vars.CONTAINER_IMAGE_NAME }}:latest
|
||||||
jobs:
|
jobs:
|
||||||
gitea-release:
|
gitea-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -35,5 +35,39 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
tags: ${{ env.REGISTRY }}/chamomind/jws-backend:latest
|
tags: ${{ env.CONTAINER_IMAGE_NAME }}
|
||||||
push: true
|
push: true
|
||||||
|
- name: Notify Discord Success
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
curl -H "Content-Type: application/json" -X POST \
|
||||||
|
-d '{
|
||||||
|
"embeds": [{
|
||||||
|
"title": "✅ Gitea Local Deployment Success!",
|
||||||
|
"description": "**Details:**\n- Image: `${{ env.CONTAINER_IMAGE_NAME }}`\n- Deployed by: `${{ github.actor }}`",
|
||||||
|
"color": 3066993,
|
||||||
|
"footer": {
|
||||||
|
"text": "Gitea Local 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()
|
||||||
|
run: |
|
||||||
|
curl -H "Content-Type: application/json" -X POST \
|
||||||
|
-d '{
|
||||||
|
"embeds": [{
|
||||||
|
"title": "❌ Gitea Local Deployment Failed!",
|
||||||
|
"description": "**Details:**\n- Image: `${{ env.CONTAINER_IMAGE_NAME }}`\n- Attempted by: `${{ github.actor }}`",
|
||||||
|
"color": 15158332,
|
||||||
|
"footer": {
|
||||||
|
"text": "Gitea Local Release Notification",
|
||||||
|
"icon_url": "https://example.com/failure-icon.png"
|
||||||
|
},
|
||||||
|
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||||
|
}]
|
||||||
|
}' \
|
||||||
|
${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue