From ef615d38f773aa37f32f32096c65c10f53364ff5 Mon Sep 17 00:00:00 2001 From: ben-dydx-ops Date: Thu, 11 Dec 2025 11:12:51 +0100 Subject: [PATCH 1/2] Add failure notification job to deployer workflow Adds a job to notify a bot in case of deployment failure. --- .github/workflows/deployer.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/deployer.yml b/.github/workflows/deployer.yml index 9b5cd9ec95..063f9e4a7b 100644 --- a/.github/workflows/deployer.yml +++ b/.github/workflows/deployer.yml @@ -223,3 +223,31 @@ jobs: # Force push the changes to the main branch sleep 1 git push --force origin main + # ======================================== + # JOB 4: Notify Failure + # ======================================== + notify-failure: + runs-on: ubuntu-latest + needs: [fetch-versions, determine-if-deployment-needed, deploy] + if: failure() || cancelled() + steps: + - name: Send failure notice to deploymentPromoted bot + env: + BOT_ENDPOINT: https://deployment-promoted.vercel.app/api/deploymentPromoted + PROJECT_NAME: v4-web + LATEST_PATCH: ${{ needs.fetch-versions.outputs.latest-patch-in-line-version }} + PRODUCTION_VERSION: ${{ needs.fetch-versions.outputs.production-version }} + run: | + VERSION_PAYLOAD="$LATEST_PATCH" + if [ -z "$VERSION_PAYLOAD" ]; then + VERSION_PAYLOAD="$PRODUCTION_VERSION" + fi + + curl -X POST "$BOT_ENDPOINT" \ + -H "Content-Type: application/json" \ + -d "$(jq -n \ + --arg project "$PROJECT_NAME" \ + --arg status "failed" \ + --arg version "$VERSION_PAYLOAD" \ + --arg workflow_run "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ + '{project: $project, status: $status, version: $version, meta: {workflow_run: $workflow_run}}')" From 46b5fa4ce4330681fa2a962d1d3ff4023157c7e5 Mon Sep 17 00:00:00 2001 From: ben-dydx-ops Date: Thu, 11 Dec 2025 11:17:29 +0100 Subject: [PATCH 2/2] Use variable for BOT_ENDPOINT in deployer.yml --- .github/workflows/deployer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployer.yml b/.github/workflows/deployer.yml index 063f9e4a7b..3868bb2ed5 100644 --- a/.github/workflows/deployer.yml +++ b/.github/workflows/deployer.yml @@ -233,7 +233,7 @@ jobs: steps: - name: Send failure notice to deploymentPromoted bot env: - BOT_ENDPOINT: https://deployment-promoted.vercel.app/api/deploymentPromoted + BOT_ENDPOINT: ${{ vars.DEPLOYMENT_PROMOTED_URL }} PROJECT_NAME: v4-web LATEST_PATCH: ${{ needs.fetch-versions.outputs.latest-patch-in-line-version }} PRODUCTION_VERSION: ${{ needs.fetch-versions.outputs.production-version }}