From 335d010c0d42c38958b3d17433de4179b4a8b434 Mon Sep 17 00:00:00 2001 From: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:47:25 +0200 Subject: [PATCH 1/5] Add github action to docs --- content/en/deployment_gates/setup.md | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/content/en/deployment_gates/setup.md b/content/en/deployment_gates/setup.md index d3c9dd7a6a8ec..1faf1891450e8 100644 --- a/content/en/deployment_gates/setup.md +++ b/content/en/deployment_gates/setup.md @@ -236,6 +236,59 @@ spec: [6]: https://app.datadoghq.com/organization-settings/application-keys [7]: https://github.com/DataDog/datadog-ci/tree/master/packages/datadog-ci/src/commands/deployment#gate +{{% /tab %}} +{{% tab "Github Actions" %}} +Datadog provides a Github Action to make it simple to integrate with Deployment Gates: + +```yaml +name: Deploy with Datadog Deployment Gate + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Deploy Canary + run: | + echo "Deploying canary release for service:'my-service' in 'production'. Version 1.0.1" + # Your deployment commands here + + - name: Evaluate Deployment Gate + uses: DataDog/deployment-gate-github-action@v1 + env: + DD_API_KEY: ${{ secrets.DD_API_KEY }} + DD_APP_KEY: ${{ secrets.DD_APP_KEY }} + with: + service: 'my-service' + env: 'production' + + - name: Deploy + if: success() + run: | + echo "Deployment Gate passed, proceeding with deployment" + # Your deployment commands here +``` + +The Github action wraps around the [`datadog-ci` command][1], and as such has the same behavior, parameters and requirements. + + +**Required environment variables**: +* `DD_API_KEY`: Your [Datadog API key][2], used to authenticate the requests. +* `DD_APP_KEY`: Your [Datadog application key][3], used to authenticate the requests. + +For complete configuration options and detailed usage examples, refer to the [`deployment-gate-action` repository][4]. + +[1]: https://github.com/DataDog/datadog-ci +[2]: https://app.datadoghq.com/organization-settings/api-keys +[3]: https://app.datadoghq.com/organization-settings/application-keys +[4]: https://github.com/DataDog/deployment-gate-github-action + {{% /tab %}} {{% tab "Generic script" %}} From 2b15de67ccbdc0f0c86cd3082c48ebdf44a65a31 Mon Sep 17 00:00:00 2001 From: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com> Date: Thu, 25 Sep 2025 10:02:00 +0200 Subject: [PATCH 2/5] Fix docs --- content/en/deployment_gates/setup.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/content/en/deployment_gates/setup.md b/content/en/deployment_gates/setup.md index 1faf1891450e8..37f00a626db17 100644 --- a/content/en/deployment_gates/setup.md +++ b/content/en/deployment_gates/setup.md @@ -237,28 +237,24 @@ spec: [7]: https://github.com/DataDog/datadog-ci/tree/master/packages/datadog-ci/src/commands/deployment#gate {{% /tab %}} -{{% tab "Github Actions" %}} -Datadog provides a Github Action to make it simple to integrate with Deployment Gates: +{{% tab "GitHub Actions" %}} +Datadog provides a Github Action to integrate with Deployment Gates: ```yaml name: Deploy with Datadog Deployment Gate - on: push: branches: [main] - jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5 - - name: Deploy Canary run: | echo "Deploying canary release for service:'my-service' in 'production'. Version 1.0.1" # Your deployment commands here - - name: Evaluate Deployment Gate uses: DataDog/deployment-gate-github-action@v1 env: @@ -267,7 +263,6 @@ jobs: with: service: 'my-service' env: 'production' - - name: Deploy if: success() run: | @@ -275,14 +270,14 @@ jobs: # Your deployment commands here ``` -The Github action wraps around the [`datadog-ci` command][1], and as such has the same behavior, parameters and requirements. +The GitHub action wraps around the [`datadog-ci` command][1], and as such has the same behavior, parameters and requirements. **Required environment variables**: * `DD_API_KEY`: Your [Datadog API key][2], used to authenticate the requests. * `DD_APP_KEY`: Your [Datadog application key][3], used to authenticate the requests. -For complete configuration options and detailed usage examples, refer to the [`deployment-gate-action` repository][4]. +For complete configuration options and detailed usage examples, see the [`deployment-gate-action` repository][4]. [1]: https://github.com/DataDog/datadog-ci [2]: https://app.datadoghq.com/organization-settings/api-keys From 8fe260d148dec17f441ee9a2715b1799641f488a Mon Sep 17 00:00:00 2001 From: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com> Date: Thu, 25 Sep 2025 11:59:12 +0200 Subject: [PATCH 3/5] Fix 'Github' --- content/en/deployment_gates/setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/deployment_gates/setup.md b/content/en/deployment_gates/setup.md index 37f00a626db17..631dc1643a3e4 100644 --- a/content/en/deployment_gates/setup.md +++ b/content/en/deployment_gates/setup.md @@ -238,7 +238,7 @@ spec: {{% /tab %}} {{% tab "GitHub Actions" %}} -Datadog provides a Github Action to integrate with Deployment Gates: +Datadog provides a GitHub Action to integrate with Deployment Gates: ```yaml name: Deploy with Datadog Deployment Gate From 99fa9c03ada78282306f069f1dc34304cfec8702 Mon Sep 17 00:00:00 2001 From: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com> Date: Thu, 25 Sep 2025 12:51:35 +0200 Subject: [PATCH 4/5] Update setup.md --- content/en/deployment_gates/setup.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/en/deployment_gates/setup.md b/content/en/deployment_gates/setup.md index 631dc1643a3e4..4ade46d340a9c 100644 --- a/content/en/deployment_gates/setup.md +++ b/content/en/deployment_gates/setup.md @@ -251,10 +251,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 - - name: Deploy Canary + + - name: Deploy Canary run: | echo "Deploying canary release for service:'my-service' in 'production'. Version 1.0.1" # Your deployment commands here + - name: Evaluate Deployment Gate uses: DataDog/deployment-gate-github-action@v1 env: @@ -263,6 +265,7 @@ jobs: with: service: 'my-service' env: 'production' + - name: Deploy if: success() run: | From 55177e00948c694930d5301491d269204ac3d210 Mon Sep 17 00:00:00 2001 From: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com> Date: Thu, 25 Sep 2025 16:25:20 +0200 Subject: [PATCH 5/5] Address feedback --- content/en/deployment_gates/setup.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/content/en/deployment_gates/setup.md b/content/en/deployment_gates/setup.md index 4ade46d340a9c..c020b4b8d9565 100644 --- a/content/en/deployment_gates/setup.md +++ b/content/en/deployment_gates/setup.md @@ -127,8 +127,8 @@ The command has the following behavior: Note that the `deployment gate` command is available in datadog-ci versions v3.17.0 and above. **Required environment variables**: -* `DD_API_KEY`: Your [Datadog API key][2], used to authenticate the requests. -* `DD_APP_KEY`: Your [Datadog application key][3], used to authenticate the requests. +* `DD_API_KEY`: Your [API key][2], used to authenticate the requests. +* `DD_APP_KEY`: Your [Application key][3], used to authenticate the requests. * `DD_BETA_COMMANDS_ENABLED=1`: The `deployment gate` command is a beta command, so datadog-ci needs to be run with beta commands enabled. For complete configuration options and detailed usage examples, refer to the [`deployment gate` command documentation][4]. @@ -238,7 +238,9 @@ spec: {{% /tab %}} {{% tab "GitHub Actions" %}} -Datadog provides a GitHub Action to integrate with Deployment Gates: +The [`Datadog Deployment Gate GitHub Action`][4] includes all the required logic to evaluate a Deployment Gate during the deployment of a service. + +Add a `DataDog/deployment-gate-github-action` step to your existing deployment workflow, for example: ```yaml name: Deploy with Datadog Deployment Gate @@ -249,9 +251,6 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v5 - - name: Deploy Canary run: | echo "Deploying canary release for service:'my-service' in 'production'. Version 1.0.1" @@ -273,14 +272,18 @@ jobs: # Your deployment commands here ``` -The GitHub action wraps around the [`datadog-ci` command][1], and as such has the same behavior, parameters and requirements. - +If the Deployment Gate being evaluated contains APM Faulty Deployment Detection rules, you must also specify the version (for example, `version: 1.0.1`). +The action has the following behavior: +* It sends a request to start the gate evaluation and blocks until the evaluation is complete. +* It provides a configurable timeout to determine the maximum amount of time to wait for an evaluation to complete. +* It has built-in automatic retries for errors. +* It allows you to customize its behavior in case of unexpected Datadog errors with the `fail-on-error` parameter. **Required environment variables**: -* `DD_API_KEY`: Your [Datadog API key][2], used to authenticate the requests. -* `DD_APP_KEY`: Your [Datadog application key][3], used to authenticate the requests. +* `DD_API_KEY`: Your [API key][2], used to authenticate the requests. +* `DD_APP_KEY`: Your [Application key][3], used to authenticate the requests. -For complete configuration options and detailed usage examples, see the [`deployment-gate-action` repository][4]. +For complete configuration options and detailed usage examples, see the [`DataDog/deployment-gate-github-action` repository][4]. [1]: https://github.com/DataDog/datadog-ci [2]: https://app.datadoghq.com/organization-settings/api-keys