Deploys
Deployment tracking and monitoring with health checks and rollback capabilities.
What Deploys does
Deploys tracks the full lifecycle of a release: initiated → building → deploying → live (or failed → rolled_back). The GitHub Actions provider polls workflow runs and emits a `deploy` event for every state transition; the manual provider lets your CI script call `client.emit()` directly. Each event carries the commit SHA, the branch, the environment, and a link to build logs.
Rollback is a foreign key. Every deploy row has an optional `rollback_target_id` pointing at the deploy you rolled back to, so the dashboard can render an honest timeline including failures. Health-check correlations link a deploy to the audit log entries it produced and the perf snapshots it shifted, so you can answer 'did this deploy regress p99?' with one query.
Wire payload
Same shape, three syntaxesThe wire protocol is plain HTTP, plain JSON, HMAC-SHA256. The TypeScript tab uses the SDK; the cURL tab is the raw HTTP equivalent; the Python tab shows the preview SDK shape.
import { createCuittyClient } from "@cuitty/sdk";
import { deploysPlugin } from "@cuitty/sdk/plugins/deploys";
const cuitty = createCuittyClient({
portalUrl: "https://app.cuitty.com",
projectId: process.env.CUITTY_PROJECT_ID!,
apiKey: process.env.CUITTY_API_KEY!,
});
cuitty.use(deploysPlugin());
cuitty.start();
cuitty.use(deploysPlugin({
provider: "github",
repo: "cuitty/cuitty",
token: process.env.GITHUB_TOKEN!,
environment: "production",
onlyCompleted: true,
}));
Drop-in plugin
import { deploysPlugin } from "@cuitty/sdk/plugins/deploys";
cuitty.use(deploysPlugin({
provider: "github",
repo: "cuitty/cuitty",
token: process.env.GITHUB_TOKEN!,
}));Database schema
Excerpt from modules/deploys/schema.sql.
One libSQL file per module — back it up with cp.
CREATE TABLE IF NOT EXISTS deploys (
id INTEGER PRIMARY KEY AUTOINCREMENT,
project_id TEXT NOT NULL,
env_id INTEGER NOT NULL REFERENCES environments(id) ON DELETE CASCADE,
version TEXT,
commit_sha TEXT,
branch TEXT,
status TEXT NOT NULL DEFAULT 'initiated',
triggered_by TEXT,
build_logs_url TEXT,
started_at INTEGER DEFAULT (unixepoch()),
completed_at INTEGER,
duration_seconds INTEGER,
rollback_target_id INTEGER REFERENCES deploys(id)
);