Skip to content

Commit 14e3cdd

Browse files
committed
chore(ci): deploy the dashboard agent dormant, drop the reviewer gate, add a ref input
The agent deploys with --skip-promotion, so a deploy lands dormant and nothing goes live until DASHBOARD_AGENT_VERSION is flipped. The per-environment reviewer gate therefore bought nothing but a pile-up: every agent-path merge queued a staging+prod deploy that sat pending on an approval nobody granted, and cancel-in-progress: false made each new push cancel the previously-pending leg. In practice the agent only ever deployed via a manual dispatch + approval. Drop the environment gate so pushes deploy dormant versions unattended, flip cancel-in-progress to true so a newer push supersedes an in-flight deploy instead of stacking, and add a workflow_dispatch ref input to deploy a specific commit, branch, or tag when needed. The deploy token moves from the two environment secrets to a repo/org secret of the same name (TRIGGER_DASHBOARD_AGENT_DEPLOY_TOKEN), since dropping environment means the env-scoped secret no longer resolves.
1 parent a302f65 commit 14e3cdd

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/dashboard-agent-deploy.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ name: "🤖 Deploy dashboard agent"
33
# Deploys the @internal/dashboard-agent chat.agent to its Trigger.dev project
44
# with --skip-promotion, so a deploy never becomes "current" on its own. The
55
# consuming app cuts over by pinning DASHBOARD_AGENT_VERSION to the new version.
6-
# Runs a leg per environment (staging + prod), each gated by its own environment;
7-
# a push to main that touches the agent or its store triggers both. Version
8-
# numbers are per-environment, so pin each environment to its own leg's version.
6+
# Runs a leg per environment (staging + prod); a push to main that touches the
7+
# agent or its store deploys both. Version numbers are per-environment, so pin
8+
# each environment to its own leg's version.
9+
#
10+
# The deploy lands dormant, so it doesn't need a reviewer gate: nothing goes live
11+
# until DASHBOARD_AGENT_VERSION is flipped. The `environment:` below is kept only
12+
# to scope the deploy token per environment; its required-reviewers rule is
13+
# removed in repo settings so pushes deploy unattended. workflow_dispatch takes an
14+
# optional ref (SHA, branch, or tag) to deploy a specific commit instead of head.
915

1016
on:
1117
push:
@@ -14,6 +20,11 @@ on:
1420
- "internal-packages/dashboard-agent/**"
1521
- "internal-packages/dashboard-agent-db/**"
1622
workflow_dispatch:
23+
inputs:
24+
ref:
25+
description: "Commit SHA, branch, or tag to deploy. Defaults to the ref the workflow runs from."
26+
required: false
27+
type: string
1728

1829
permissions: {}
1930

@@ -27,11 +38,14 @@ jobs:
2738
max-parallel: 1
2839
matrix:
2940
environment: [staging, prod]
30-
# Per-environment reviewer gate + source of the scoped deploy PAT.
41+
# Kept to scope the deploy token per environment. The required-reviewers rule
42+
# on these environments is removed in repo settings, so this no longer gates.
3143
environment: dashboard-agent-${{ matrix.environment }}
3244
concurrency:
45+
# Latest deploy per environment wins; supersede an in-flight one rather
46+
# than queueing behind it.
3347
group: dashboard-agent-deploy-${{ matrix.environment }}
34-
cancel-in-progress: false
48+
cancel-in-progress: true
3549
permissions:
3650
contents: read
3751
env:
@@ -41,6 +55,9 @@ jobs:
4155
- name: Checkout
4256
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4357
with:
58+
# push: the pushed commit. workflow_dispatch: the input ref if given,
59+
# otherwise the head of the ref the run was launched from.
60+
ref: ${{ github.event.inputs.ref || github.sha }}
4461
persist-credentials: false
4562

4663
- name: Setup pnpm

0 commit comments

Comments
 (0)