Skip to content

Commit

Permalink
feat: add datadog deployment event
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed Jan 24, 2024
1 parent dd35a91 commit 6a28f1b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/serverless-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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"
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"

0 comments on commit 6a28f1b

Please sign in to comment.