For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quickstart: environment action

Start Duku automatically for stable environments.

Use this workflow for a target you keep in Viewport, such as staging or a production canary.

1

1. Create the target in Viewport

Open the product in Viewport.

Create the target from the target menu in the top-right navbar, next to the active product.

Store its ID as a repository variable such as DUKU_STAGING_TARGET_ID.

2

2. Add the repository secret

Create PLATFORM_API_KEY in Viewport, under Settings → API Keys.

Store it as the repository secret PLATFORM_API_KEY.

3

3. Create the workflow file

Copy this file into .github/workflows/duku-environment.yml:

name: Duku environment

on:
  push:
    branches: [main]
  workflow_dispatch:

concurrency:
  group: duku-env-${{ vars.DUKU_STAGING_TARGET_ID }}
  cancel-in-progress: false

jobs:
  explore:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: duku-ai/actions/environment@environment/v0.1.0
        with:
          api-key: ${{ secrets.PLATFORM_API_KEY }}
          target-id: ${{ vars.DUKU_STAGING_TARGET_ID }}
4

4. Update the workflow values

  • branches: [main] should match the branch that deploys this environment.

  • api-key reads the repository secret PLATFORM_API_KEY.

  • target-id points to the target you created in Viewport.

The action explores the target's configured build URL.

Set url: if you need to override that URL for a specific workflow run.

cancel-in-progress: false serializes runs per target so overlapping pushes do not create duplicate explorations. Set it to true if you would rather drop earlier in flight runs.

If the target has test cases configured, the action also starts a full test-case run.

Run on a pull request against a fixed environment

Use this mode when you merge into a protected branch, such as prod, and want Duku to gate the PR by exploring a permanent environment.

name: Duku prod gate

on:
  pull_request:
    branches: [prod]

jobs:
  explore:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: duku-ai/actions/environment@environment/v0.1.0
        with:
          api-key: ${{ secrets.PLATFORM_API_KEY }}
          target-id: ${{ vars.DUKU_PROD_TARGET_ID }}

On a native pull_request event, results are also posted to the PR comment when the Duku GitHub App is installed.

Without the App, the action still runs and results still appear in Viewport.

Nightly health checks

A scheduled workflow is a good fit for nightly health checks against staging.

Last updated