Skip to main content
The devhelmhq/setup-devhelm GitHub Action installs the DevHelm CLI and authenticates it in your workflow. Use it to validate, test, and deploy monitoring configurations as part of your CI/CD pipeline.

Basic usage

name: Deploy Monitoring
on:
  push:
    branches: [main]
    paths: ['devhelm.yml']

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: devhelmhq/setup-devhelm@v1
        with:
          api-token: ${{ secrets.DEVHELM_API_TOKEN }}

      - name: Validate config
        run: devhelm validate devhelm.yml

      - name: Deploy
        run: devhelm deploy -f devhelm.yml --yes

Inputs

InputDescriptionRequired
api-tokenDevHelm API tokenYes
versionCLI version to install (default: latest)No

PR preview workflow

Show a deployment plan on pull requests:
name: Monitor Config Preview
on:
  pull_request:
    paths: ['devhelm.yml']

jobs:
  plan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: devhelmhq/setup-devhelm@v1
        with:
          api-token: ${{ secrets.DEVHELM_API_TOKEN }}

      - name: Validate
        run: devhelm validate devhelm.yml

      - name: Plan
        run: devhelm plan -f devhelm.yml

Gated deploy with dry-run

Use --detailed-exitcode to gate deploys based on whether changes exist:
- name: Check for changes
  id: dryrun
  run: devhelm deploy -f devhelm.yml --dry-run --detailed-exitcode
  continue-on-error: true

- name: Deploy (if changes)
  if: steps.dryrun.outcome == 'failure'
  run: devhelm deploy -f devhelm.yml --yes
Exit code 10 means changes are pending; exit code 0 means no changes.

Multi-environment setup

Deploy different configs per environment using matrix or branch conditions:
jobs:
  deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        env: [staging, production]
    steps:
      - uses: actions/checkout@v4

      - uses: devhelmhq/setup-devhelm@v1
        with:
          api-token: ${{ secrets[format('DEVHELM_TOKEN_{0}', matrix.env)] }}

      - run: devhelm deploy -f devhelm.${{ matrix.env }}.yml --yes

Secrets setup

  1. Go to your GitHub repository → SettingsSecrets and variablesActions
  2. Add DEVHELM_API_TOKEN with your DevHelm API key
  3. For multi-environment setups, add per-environment tokens (e.g., DEVHELM_TOKEN_STAGING, DEVHELM_TOKEN_PRODUCTION)

Next steps

YAML file format

Learn the devhelm.yml schema and resource sections.

Deploy workflow

Understand the validate → plan → deploy lifecycle.

Multi-environment

Configure staging vs production deploys.

Generic CI

Use the CLI in GitLab, Jenkins, and other CI systems.