feat : notify new update income

This commit is contained in:
2026-09-26 23:34:42 +07:00 Unverified
parent e99a5b76b1
commit 4ef1968b04
14 changed files with 499 additions and 33 deletions
+38
View File
@@ -47,6 +47,22 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4
- name: Announce incoming deployment
continue-on-error: true
env:
DEPLOYMENT_WEBHOOK_SECRET: ${{ secrets.DEPLOYMENT_WEBHOOK_SECRET }}
REVISION: ${{ gitea.sha }}
run: |
if [ -z "$DEPLOYMENT_WEBHOOK_SECRET" ]; then
echo "DEPLOYMENT_WEBHOOK_SECRET is not configured; skipping notification"
exit 0
fi
curl --fail-with-body --silent --show-error --retry 3 \
--header "Authorization: Bearer $DEPLOYMENT_WEBHOOK_SECRET" \
--header "Content-Type: application/json" \
--data "{\"deploymentId\":\"$REVISION\",\"status\":\"deploying\"}" \
"$BASE_URL/api/deployments/status"
- name: Build and push application image
run: |
docker build \
@@ -172,3 +188,25 @@ jobs:
kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" rollout status \
deployment/buzz-sheet-discord-worker \
--timeout=10m
- name: Publish deployment result
if: always()
continue-on-error: true
env:
DEPLOYMENT_WEBHOOK_SECRET: ${{ secrets.DEPLOYMENT_WEBHOOK_SECRET }}
DEPLOYMENT_JOB_STATUS: ${{ job.status }}
REVISION: ${{ gitea.sha }}
run: |
if [ -z "$DEPLOYMENT_WEBHOOK_SECRET" ]; then
echo "DEPLOYMENT_WEBHOOK_SECRET is not configured; skipping notification"
exit 0
fi
status=failed
if [ "$DEPLOYMENT_JOB_STATUS" = "success" ]; then
status=ready
fi
curl --fail-with-body --silent --show-error --retry 3 \
--header "Authorization: Bearer $DEPLOYMENT_WEBHOOK_SECRET" \
--header "Content-Type: application/json" \
--data "{\"deploymentId\":\"$REVISION\",\"status\":\"$status\"}" \
"$BASE_URL/api/deployments/status"