added ntfy notification to indicate fail or success of builds
This commit is contained in:
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
REGISTRY: git.home.db123.ir
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-depth: 1
|
||||
fetch-tags: true
|
||||
|
||||
- name: Determine version
|
||||
@@ -45,6 +45,7 @@ jobs:
|
||||
password: ${{ secrets.CICD_PASSWORD }}
|
||||
|
||||
- name: Build & push Docker image
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
@@ -56,3 +57,16 @@ jobs:
|
||||
${{ 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-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