-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
72 lines (64 loc) · 2.79 KB
/
Copy pathdashboard-agent-deploy.yml
File metadata and controls
72 lines (64 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: "🤖 Deploy dashboard agent"
# Deploys the @internal/dashboard-agent chat.agent to its Trigger.dev project
# with --skip-promotion, so a deploy never becomes "current" on its own. The
# consuming app cuts over by pinning DASHBOARD_AGENT_VERSION to the new version.
# Runs a leg per environment (staging + prod), each gated by its own environment;
# a push to main that touches the agent or its store triggers both. Version
# numbers are per-environment, so pin each environment to its own leg's version.
on:
push:
branches: [main]
paths:
- "internal-packages/dashboard-agent/**"
- "internal-packages/dashboard-agent-db/**"
workflow_dispatch:
permissions: {}
jobs:
deploy:
name: Deploy dashboard agent (${{ matrix.environment }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
# One environment at a time: parallel deploys of the same project race.
max-parallel: 1
matrix:
environment: [staging, prod]
# Per-environment reviewer gate + source of the scoped deploy PAT.
environment: dashboard-agent-${{ matrix.environment }}
concurrency:
group: dashboard-agent-deploy-${{ matrix.environment }}
cancel-in-progress: false
permissions:
contents: read
env:
TRIGGER_API_URL: https://api.trigger.dev
TRIGGER_DASHBOARD_AGENT_PROJECT_REF: ${{ vars.TRIGGER_DASHBOARD_AGENT_PROJECT_REF }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
version: 10.33.2
- name: Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.23.1
cache: "pnpm"
- name: Install + build the CLI and the agent's deps
run: |
set -euo pipefail
pnpm install --frozen-lockfile
# Prisma client is needed because the build closure pulls in @trigger.dev/database.
pnpm run generate
# Config-time imports the agent's trigger.config.ts needs: defineConfig (sdk), aptGet (build).
pnpm run build --filter trigger.dev --filter @trigger.dev/build --filter @trigger.dev/sdk
- name: Deploy (--skip-promotion)
working-directory: internal-packages/dashboard-agent
env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_DASHBOARD_AGENT_DEPLOY_TOKEN }}
# Invoke the built CLI directly (what the workspace .bin/trigger wrapper does),
# so a not-yet-linked bin after a fresh install can't break the deploy.
run: node ../../packages/cli-v3/dist/esm/index.js deploy --skip-promotion --env ${{ matrix.environment }}