From 6a28f1bde39cff1330ac5f54c6d9161346d02117 Mon Sep 17 00:00:00 2001 From: Bernardo Guerreiro Date: Wed, 24 Jan 2024 00:17:24 +0000 Subject: [PATCH] feat: add datadog deployment event --- .github/workflows/serverless-deploy.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/serverless-deploy.yaml b/.github/workflows/serverless-deploy.yaml index 4d814c3..1d0b73a 100644 --- a/.github/workflows/serverless-deploy.yaml +++ b/.github/workflows/serverless-deploy.yaml @@ -29,6 +29,9 @@ on: AWS_DEPLOYER_ROLE: description: 'AWS IAM Role to assume' required: true + DD_API_KEY: + description: 'Datadog API Key' + required: true outputs: SERVICE_URL: description: 'API Gateway endpoints' @@ -72,4 +75,18 @@ jobs: run: | SERVICE_URL="$(npx serverless info --stage ${{ inputs.ENVIRONMENT }} --verbose | grep ServiceEndpoint | sed s/ServiceEndpoint\:\ //g)" echo "::add-mask::$SERVICE_URL" - echo "SERVICE_URL=$SERVICE_URL" >> "$GITHUB_OUTPUT" \ No newline at end of file + echo "SERVICE_URL=$SERVICE_URL" >> "$GITHUB_OUTPUT" + - name: Send Datadog Deployment Event + if: success() + uses: masci/datadog@v1 + with: + api-key: ${{ secrets.DD_API_KEY }} + events: | + - title: "Deployment to ${{ inputs.ENVIRONMENT }}" + text: "Branch ${{ github.head_ref }} deployed to ${{ inputs.ENVIRONMENT }} by ${{ github.actor }}" + alert_type: "success" + source: github + tags: + - "env:${{ inputs.ENVIRONMENT }}" + - "repo:${{ github.repository }}" + - "service:movie-service" \ No newline at end of file