diff --git a/content/en/deployment_gates/setup.md b/content/en/deployment_gates/setup.md index d3c9dd7a6a8ec..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]. @@ -236,6 +236,60 @@ 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" %}} +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 +on: + push: + branches: [main] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - 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 +``` + +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 [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 [`DataDog/deployment-gate-github-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" %}}