deploy
Deploy via Semaphore promotions. Manage deployment targets, promote pipelines, deploy-and-wait.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deploy via Semaphore promotions. Manage deployment targets, promote pipelines, deploy-and-wait.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage Semaphore infrastructure — secrets, notifications, agent types, scheduled tasks, artifacts.
Diagnose sem-ai plugin issues when the sem-ai binary isn't installed yet, and guide the user through binary install. Use when the user reports sem-ai not working, MCP tools missing, slash command not found, `sem-ai connect` failing, or sees "command not found: sem-ai".
Triage and FIX flaky tests on a Semaphore project end-to-end — find the worst offenders, pull history, locate the test in the code, diagnose the root cause, write a fix or justified quarantine, and verify by re-running. Use whenever the user wants to fix/investigate flaky tests, de-flake CI, reduce intermittent failures, asks "why is CI randomly red", wants to quarantine a flake, or after `sem-ai flaky list` surfaces offenders. Goes BEYOND detection (test-intelligence) to root-cause + code change + verification.
Diagnose and fix CI pipeline failures. Step-by-step debugging with sem-ai.
Translate a repo's GitHub Actions workflows into an equivalent Semaphore pipeline. ONLY covers the GHA→Semaphore mapping and conversion procedure; for Semaphore-side depth (cache CLI, test-results, blocks structure, sharding, promotions) defer to the linked skills. Use when the user asks to convert/port/migrate GitHub Actions to Semaphore, says "translate this workflow" or "convert ci.yml", or the repo has `.github/workflows/` and the user wants Semaphore instead. Can be invoked directly as `/sem-ai:gha-to-semaphore` (or via the broader `/sem-ai:init` orchestrator).
Initialize Semaphore CI/CD for the current repository — bootstrap the Semaphore project, write a working `.semaphore/semaphore.yml` (translating from GitHub Actions if present, or from scratch), wire required secrets, validate, and watch the first workflow. Applies Semaphore-side defaults automatically — agent image, toolbox CLIs, `test-results` epilogue rule, sharding heuristics — by routing through the linked skills. Use when the user wants to set up CI on Semaphore, says "initialize", "bootstrap CI", "prepare CI/CD for this project", "create a workflow on Semaphore", "make a `.semaphore` config", or runs `/sem-ai:init`.
| name | deploy |
| description | Deploy via Semaphore promotions. Manage deployment targets, promote pipelines, deploy-and-wait. |
| user-invocable | false |
sem-ai pipeline promote <pipeline-id>
# Returns list of available promotion targets (no --target = list mode)
# Dry run (safe — does NOT execute)
sem-ai pipeline promote <id> --target "Staging Deploy"
# Execute
sem-ai pipeline promote <id> --target "Staging Deploy" --confirm
# Execute and wait for promoted pipeline to finish
sem-ai promote-and-wait <id> --target "Staging Deploy" --confirm
# Override conditions (deploy despite failures)
sem-ai pipeline promote <id> --target "Staging" --confirm --override
# With parameters (each --param becomes a promotion env var)
sem-ai pipeline promote <id> --target "Production" --confirm --param version=1.2.3
sem-ai pipeline promote <id> --target "Production Deploy" --confirm --param SERVICE=web
sem-ai deploy targets --project my-app # list
sem-ai deploy show <target-id> # details
sem-ai deploy history <target-id> # history
sem-ai deploy activate <target-id> # enable
sem-ai deploy deactivate <target-id> # cordon (disable)
sem-ai deploy delete <target-id> # remove
sem-ai deploy create <name> builds the target's restriction surface from flags. If a rule type (BRANCH / TAG / PR) has no flag, that type is implicitly blocked — this is the right safe default for tag-only release targets.
sem-ai deploy create release \
--project my-app \
--description "Auto-promoted on v* tag" \
--tag-regex '^v[0-9]+\.[0-9]+\.[0-9]+$' \
--subject-auto \
--env-var GITHUB_TOKEN=<personal-access-token>
Result: only auto-promotion (from auto_promote.when) on tags matching the regex can trigger this. Manual clicks blocked. Branch/PR pipelines cannot promote here.
sem-ai deploy create snapshot \
--project my-app \
--branch-exact main \
--subject-any
Result: any team member can promote, but only on the main branch.
| Flag | Effect |
|---|---|
--tag-regex <pattern> | Allow tags matching Perl-compatible regex |
--tag-exact <name> | Allow exact tag name only |
--allow-all-tags | Allow promotion from any tag |
--branch-regex <pattern> | Allow branches matching regex |
--branch-exact <name> | Allow exact branch name only |
--allow-all-branches | Allow promotion from any branch |
--allow-prs | Allow promotion from pull requests |
You can pass multiple type flags in one call (e.g. --branch-exact main --tag-regex '^v[0-9].*' to allow main-branch promotions AND v-tag promotions).
| Flag | Effect |
|---|---|
--subject-any | Anyone with project access |
--subject-user <uuid-or-git_login> | Specific user (repeatable; UUID auto-detected vs git_login) |
--subject-role <role> | Members of a role like Admin or Contributor (repeatable) |
--subject-auto | Auto-promotion conditions only — blocks manual clicks |
If no subject flag is passed, the API default applies (typically ANY).
--env-var NAME=VALUE # repeatable
--file /etc/conf=/local/source.txt # repeatable; base64-encodes content
Secrets bound to a deployment target are only visible to pipelines triggered THROUGH that target — more restrictive than project-level secrets. Prefer these for release credentials (e.g. GITHUB_TOKEN for goreleaser, deploy keys, registry creds).
--bookmark1 staging --bookmark2 us-east-1 --bookmark3 v1.2
Pure metadata for filtering the deployment history page on the Semaphore web UI. Does NOT restrict who/what can trigger — that's --subject-* / --branch-* / --tag-*.
sem-ai deploy update <target-id> PATCHes the target. Only flags you pass are sent; everything else is preserved server-side.
# Tighten the release tag pattern
sem-ai deploy update <id> --tag-regex '^v[0-9]+\.[0-9]+\.[0-9]+$'
# Rotate a target-bound secret
sem-ai deploy update <id> --env-var GITHUB_TOKEN=<new-pat>
# Rename
sem-ai deploy update <id> --name release-v2
# Replace subject rules with a more restrictive set
sem-ai deploy update <id> --subject-role Admin --subject-auto
Note: list/array fields (object_rules, subject_rules, env_vars, files) are replaced by what you send — not merged. To preserve existing rules, re-pass them alongside the new ones, OR fetch the current state via deploy show first.
In the pipeline's promotions: block, reference the target by name:
promotions:
- name: Publish GitHub Release
pipeline_file: release.yml
auto_promote:
when: "tag =~ '^v.*' AND result = 'passed'"
deployment_target: release
The deployment_target: line enforces gating on BOTH auto and manual triggers, unlike auto_promote.when which only gates auto-firing.
# 1. Verify tests pass
sem-ai test summary --pipeline <id>
# 2. Deploy to staging and wait
sem-ai promote-and-wait <id> --target "Staging" --confirm
# 3. Check staging result
# (promoted pipeline ID is in the output above)
# 4. Deploy to production
sem-ai promote-and-wait <id> --target "Production" --confirm
--confirm: dry run only.--override bypasses conditions — confirm with user first.--subject-* flag may default to ANY (anyone can trigger) — surface this when scaffolding release targets and prefer --subject-auto for tag-only release flows.deploy update REPLACES list fields. To merge new rules into existing ones, fetch current state with deploy show first.