Build and deploy Datadog Apps using GitHub Actions.
To get started:
- Add your Datadog API and Application Keys as secrets to your GitHub
repository.
- For more information, see API and Application Keys.
- In your GitHub workflow, use
DataDog/apps-github-action.
name: Continuous Deployment
on:
push:
branches:
- main
permissions:
contents: read
jobs:
deploy-app:
name: Deploy Datadog App
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v6
- name: Deploy
id: deploy
uses: DataDog/apps-github-action
with:
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
datadog-app-key: ${{ secrets.DATADOG_APP_KEY }}name: Continuous Deployment
on:
push:
branches:
- main
paths:
- path/to/your/app/**
permissions:
contents: read
jobs:
deploy-app:
name: Deploy Datadog App
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v6
- name: Deploy
id: deploy
uses: DataDog/apps-github-action
with:
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
datadog-app-key: ${{ secrets.DATADOG_APP_KEY }}
app-directory: path/to/your/appThe action installs your app's dependencies, then builds, uploads, and publishes
the app with the
Datadog Apps CLI by running
datadog-apps deploy in your app's directory, always through npx. When the
CLI is already installed in your app's node_modules (for example, as a
dependency installed by your install command), that version runs. Otherwise,
npx fetches the version from the cli-version input into the runner user's
npx cache — there is no global install, so the action needs no write access to
npm's global prefix and mutates no shared runner state. The CLI builds the app
by running the project's build script with the project's own package manager,
then uploads and publishes the built app to Datadog. Every option the action
supplies — the site and the version name (the commit SHA, GITHUB_SHA) — is
passed to the CLI as a command-line flag. Only the API and app keys are passed
through the environment, which is where the CLI reads them from.
| Input | Description | Required | Default |
|---|---|---|---|
datadog-api-key |
Your Datadog API key. This key is created in your Datadog organization and should be stored as a secret | Yes | |
datadog-app-key |
Your Datadog application key. This key is created in your Datadog organization and should be stored as a secret | Yes | |
app-directory |
The path to your Datadog App's root directory | No | . |
install-command |
Command to install dependencies before deploying | No | npm ci |
datadog-site |
Datadog site to deploy to (for example, datadoghq.eu). When not set, the CLI resolves the site from the DD_SITE or DATADOG_SITE environment variable, or the datadogSite field of the app's datadog-app.config.json |
No | |
cli-version |
Version of @datadog/apps-cli to run when the CLI is not installed in the app's node_modules; npx fetches that version at runtime. Ignored otherwise |
No | latest |
See CONTRIBUTING.md