Skip to content

Commit 2763b31

Browse files
authored
feat: send optional metric to datadog (#6)
1 parent a9315d5 commit 2763b31

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/reusable-terraform-apply.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ on:
3232
ssh-private-key:
3333
description: "A deploy key that grants read access to Terraform modules in golden-path-iac"
3434
required: true
35+
datadog-api-key:
36+
description: "Datadog API key for sending deployment events"
37+
required: false
3538

3639
defaults:
3740
run:
@@ -53,7 +56,7 @@ jobs:
5356

5457
- name: Determine stacks to deploy
5558
id: determine
56-
uses: oslokommune/composite-actions/determine-stacks@c4abc960b37045adb14eee42952a345607e5d39d # determine-stacks-v1.1.1
59+
uses: oslokommune/composite-actions/determine-stacks@e4a52c90b079620c92e671cd9a71381765a6850f # determine-stacks-v1.1.2
5760
with:
5861
selected-stacks: ${{ inputs.selected-stacks }}
5962
ignored-stacks: ${{ inputs.ignored-stacks }}
@@ -121,7 +124,7 @@ jobs:
121124

122125
- name: Deploy
123126
id: deploy
124-
uses: oslokommune/composite-actions/terraform-deploy@19c914aa4ae44b0e27a7b819ffca4710ea10316c # terraform-deploy-v1.3.3
127+
uses: oslokommune/composite-actions/terraform-deploy@223d2fb543b9edd1bbf6f9ca6d9d797bd57e82a3 # terraform-deploy-v1.6.0
125128
# We skip deployment if job is stale instead of cancelling it, as cancellation would
126129
# stop the entire workflow - potentially not deploying other stacks that have had their
127130
# files changed. Also, we don't want to risk cancelling jobs that are mid-apply.
@@ -133,6 +136,7 @@ jobs:
133136
stack-dir: ${{ matrix.stack }}
134137
config: ${{ steps.config.outputs.result }}
135138
github-deploy-key: ${{ secrets.ssh-private-key }}
139+
datadog-api-key: ${{ secrets.datadog-api-key }}
136140

137141
deploy-dev-apps:
138142
name: "Deploy dev (apps)"
@@ -181,7 +185,7 @@ jobs:
181185

182186
- name: Deploy
183187
id: deploy
184-
uses: oslokommune/composite-actions/terraform-deploy@19c914aa4ae44b0e27a7b819ffca4710ea10316c # terraform-deploy-v1.3.3
188+
uses: oslokommune/composite-actions/terraform-deploy@223d2fb543b9edd1bbf6f9ca6d9d797bd57e82a3 # terraform-deploy-v1.6.0
185189
# We skip deployment if job is stale instead of cancelling it, as cancellation would
186190
# stop the entire workflow - potentially not deploying other stacks that have had their
187191
# files changed. Also, we don't want to risk cancelling jobs that are mid-apply.
@@ -192,6 +196,7 @@ jobs:
192196
stack-dir: ${{ matrix.stack }}
193197
config: ${{ steps.config.outputs.result }}
194198
github-deploy-key: ${{ secrets.ssh-private-key }}
199+
datadog-api-key: ${{ secrets.datadog-api-key }}
195200

196201
deploy-prod-core:
197202
name: "Deploy prod (core)"
@@ -243,7 +248,7 @@ jobs:
243248

244249
- name: Deploy
245250
id: deploy
246-
uses: oslokommune/composite-actions/terraform-deploy@19c914aa4ae44b0e27a7b819ffca4710ea10316c # terraform-deploy-v1.3.3
251+
uses: oslokommune/composite-actions/terraform-deploy@223d2fb543b9edd1bbf6f9ca6d9d797bd57e82a3 # terraform-deploy-v1.6.0
247252
# We skip deployment if job is stale instead of cancelling it, as cancellation would
248253
# stop the entire workflow - potentially not deploying other stacks that have had their
249254
# files changed. Also, we don't want to risk cancelling jobs that are mid-apply.
@@ -254,6 +259,7 @@ jobs:
254259
stack-dir: ${{ matrix.stack }}
255260
config: ${{ steps.config.outputs.result }}
256261
github-deploy-key: ${{ secrets.ssh-private-key }}
262+
datadog-api-key: ${{ secrets.datadog-api-key }}
257263

258264
deploy-prod-apps:
259265
name: "Deploy prod (apps)"
@@ -306,7 +312,7 @@ jobs:
306312

307313
- name: Deploy
308314
id: deploy
309-
uses: oslokommune/composite-actions/terraform-deploy@19c914aa4ae44b0e27a7b819ffca4710ea10316c # terraform-deploy-v1.3.3
315+
uses: oslokommune/composite-actions/terraform-deploy@223d2fb543b9edd1bbf6f9ca6d9d797bd57e82a3 # terraform-deploy-v1.6.0
310316
# We skip deployment if job is stale instead of cancelling it, as cancellation would
311317
# stop the entire workflow - potentially not deploying other stacks that have had their
312318
# files changed. Also, we don't want to risk cancelling jobs that are mid-apply.
@@ -317,3 +323,4 @@ jobs:
317323
stack-dir: ${{ matrix.stack }}
318324
config: ${{ steps.config.outputs.result }}
319325
github-deploy-key: ${{ secrets.ssh-private-key }}
326+
datadog-api-key: ${{ secrets.datadog-api-key }}

0 commit comments

Comments
 (0)