From b1386011106d58d8f023fa366d5a77c03a0ff0c5 Mon Sep 17 00:00:00 2001 From: db1234719 Date: Mon, 24 Nov 2025 15:54:52 +0330 Subject: [PATCH] added ntfy notification to indicate fail or success of builds --- .gitea/workflows/build.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6ba12e5..890d6ce 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -5,7 +5,7 @@ on: branches: - main tags: - - 'v*' + - "v*" env: REGISTRY: git.home.db123.ir @@ -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