added ntfy notification to indicate fail or success of builds

This commit is contained in:
db1234719
2025-11-24 15:54:52 +03:30
parent ebea6c67da
commit b138601110

View File

@@ -5,7 +5,7 @@ on:
branches: branches:
- main - main
tags: tags:
- 'v*' - "v*"
env: env:
REGISTRY: git.home.db123.ir REGISTRY: git.home.db123.ir
@@ -45,6 +45,7 @@ jobs:
password: ${{ secrets.CICD_PASSWORD }} password: ${{ secrets.CICD_PASSWORD }}
- name: Build & push Docker image - name: Build & push Docker image
id: build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
@@ -56,3 +57,16 @@ jobs:
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:cache cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:cache,mode=max cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:cache,mode=max
- name: Notify build result
if: always()
run: |
if [ "${{ steps.build.outcome }}" = "success" ]; then
curl -s -S -u "server:VKbpgw75KB0biM" \
-d "build & push succeeded ✅" \
https://ntfy.home.db123.ir/build
else
curl -s -S -u "server:VKbpgw75KB0biM" \
-d "build & push FAILED ❌" \
https://ntfy.home.db123.ir/build
fi