Add actions to your repository
1
Generate workflow files
In a terminal, run these commands and select GitHub Actions as the CI/CD provider to create a folder with example actions:The command creates the example actions “deploy” and “dry run” in a
.github/workflows folder. Adapt the actions to your requirements.2
Adapt the actions
Use the The You can also add flags and arguments to the
on: section to specify when the action should run. In this example, it runs on every push to the main branch. Use GitHub’s branch protection rules to prevent direct pushes to the main branch and require pull requests for changes. This ensures that all changes can be reviewed before they’re deployed.You can also set workflow_dispatch to allow the action to be triggered manually. See GitHub’s Events that trigger workflows article for more options.Use build or deploy actions with the --dry-run flag to validate modules on any branch. You can configure these as pull request checks.environment property lets you keep different secrets and values for variables like IDP_CLIENT_SECRET and IDP_TENANT_ID for each CDF environment (for example, dev, staging, prod) you’re deploying to.cdf build and cdf deploy commands. For example, you can add --verbose to get richer logs.Add environment variables and secrets
1
Set up environment variables and secrets
To use the GitHub Actions, you need to set up environment variables and secrets in your repository settings.
The values are used in the GitHub Actions workflow file. Environment variables (for example

${{ vars.CDF_CLUSTER }}) are visible to anyone with access to the repository. Secrets (for example ${{ secrets.IDP_CLIENT_SECRET }}) are encrypted and only available to the GitHub Actions workflow.A standard client credentials flow requires these environment variables and secrets:Variables- CDF_CLUSTER
- CDF_PROJECT
- LOGIN_FLOW: (client_credentials)
- IDP_CLIENT_ID
- IDP_TOKEN_URL (if you’re not using Entra ID)
- IDP_CLIENT_SECRET
View Action run details
1
View Action run details
You can see the status of each run and step of the actions in the Actions tab of your repository. Click a step to see the logs.
