Wire dsp publish into your build so every merge produces a fresh URL. Common cases are an HTML report from your build (a static dashboard, an MkDocs site, an agent-authored research dossier regenerated on a schedule).
Authentication
In every CI flow, set the DISPLAYDEV_API_KEY secret. The CLI reads it from the environment:
export DISPLAYDEV_API_KEY=<api-key>
BASE_VERSION=$(dsp get <shortId> | jq -r .currentVersion)
dsp publish report/index.html --id <shortId> --base-version "$BASE_VERSION"Store the key as a GitHub Actions secret, GitLab CI variable, or whatever your CI exposes. Never check it in.
Label CI publishes for the audit log
--actor-name labels the publish so the audit log distinguishes CI runs from hand publishes. The actor classification stamped alongside it depends on the credential:
- User-scoped API key —
agent(CI is non-TTY, so the CLI's auto-detection lands on agent). - Organization-scoped API key —
service(the server stamps this from the credential; not overridable).
BASE_VERSION=$(dsp get <shortId> | jq -r .currentVersion)
dsp publish report/index.html --id <shortId> --base-version "$BASE_VERSION" --actor-name ci-deploySee Actor for the full classification.
GitHub Actions
name: Publish report
on:
push:
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: npm ci
- run: npm run build:report
- run: |
BASE_VERSION=$(npx -y @displaydev/cli get "${{ vars.DISPLAY_ARTIFACT_ID }}" | jq -r .currentVersion)
npx -y @displaydev/cli publish dist/report.html --id "${{ vars.DISPLAY_ARTIFACT_ID }}" --base-version "$BASE_VERSION"
env:
DISPLAYDEV_API_KEY: ${{ secrets.DISPLAYDEV_API_KEY }}Try this without committing
Before pushing the YAML, sanity-check the publish locally:
export DISPLAYDEV_API_KEY=<api-key>
BASE_VERSION=$(dsp get <shortId> | jq -r .currentVersion)
dsp publish dist/report.html --id <shortId> --base-version "$BASE_VERSION"If the local invocation prints a URL, your YAML will work too.
GitLab CI
publish:
stage: deploy
image: node:22
script:
- npm ci
- npm run build:report
- |
BASE_VERSION=$(npx -y @displaydev/cli get "$DISPLAY_ARTIFACT_ID" | jq -r .currentVersion)
npx -y @displaydev/cli publish dist/report.html --id "$DISPLAY_ARTIFACT_ID" --base-version "$BASE_VERSION"
variables:
DISPLAYDEV_API_KEY: $DISPLAYDEV_API_KEY
only:
- mainSet DISPLAYDEV_API_KEY and DISPLAY_ARTIFACT_ID as CI/CD variables in the project settings. Each run reads the current version with dsp get <shortId> immediately before publishing; if another publish lands between the read and write, reconcile and rerun with the new version printed by the CLI.