added ntfy notification to indicate fail or success of builds
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user