Skip to content

feat(cli): [3/3] add cs deploy github command for PR deployments#184

Open
alexvcodesphere wants to merge 3 commits intocodesphere-cloud:mainfrom
alexvcodesphere:feat/3-deploy-github-command
Open

feat(cli): [3/3] add cs deploy github command for PR deployments#184
alexvcodesphere wants to merge 3 commits intocodesphere-cloud:mainfrom
alexvcodesphere:feat/3-deploy-github-command

Conversation

@alexvcodesphere
Copy link
Member

PR 3/3: CLI Deploy GitHub Command

Add cs deploy github subcommand for GitHub Actions integration.

Changes

  • cli/cmd/deploy.go — Parent cs deploy command
  • cli/cmd/deploy_github.go — Reads GitHub Actions env vars, manages workspace lifecycle, writes GITHUB_OUTPUT
  • cli/cmd/root.go — Wires AddDeployCmd

Flags

--plan-id, --branch/-b, --stages, --profile/-p, --env, --timeout, --vpn-config

Merge Order

Merge PR 1/3 (#182) first, then PR 2/3 (#183), then this PR.

  1. PR 1/3 (feat: [1/3] refactor pipeline into shared package with step-aware log streaming #182) — pipeline refactor + streaming
  2. PR 2/3 (feat: [2/3] add provider-agnostic deploy package for preview environments #183) — pkg/deploy package
  3. PR 3/3 ← this PR — cs deploy github CLI command

…ming

Extract pipeline stage execution from cli/cmd/start_pipeline.go into a
reusable pkg/pipeline package with a Runner that orchestrates stage
execution, discovers sub-steps from the IDE server's pipeline status API,
and streams logs per-step via SSE.

- Add pkg/pipeline with Runner, Client interface, and step discovery
- Add StreamLogs SSE method to api/workspace.go for real-time log output
- Add StreamLogs to cli/cmd Client interface
- Refactor start_pipeline.go to delegate to pipeline.Runner
- Add pipeline streaming unit tests (single/multi-step, no-stream cases)
- Update .mockery.yml for pipeline mock generation

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
Add pkg/deploy with a Deployer that orchestrates workspace lifecycle:
find, create, update, delete, and run pipeline stages. Uses DevDomain
from the workspace API for deployment URLs instead of hardcoding.

- Deployer embeds pipeline.Client for pipeline operations
- Config is provider-agnostic (no GitHub/GitLab references)
- 11 ginkgo test cases covering all code paths
- Generated mocks via mockery

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
Add the cs deploy github subcommand that integrates with GitHub Actions
to manage preview workspaces. Reads GitHub env vars (GITHUB_EVENT_NAME,
GITHUB_HEAD_REF, etc.) to detect PR context and create/update/delete
workspaces accordingly.

- Add cli/cmd/deploy.go parent command
- Add cli/cmd/deploy_github.go with GitHub Actions integration
- Wire AddDeployCmd in root.go
- Support --profile, --branch, --env, --stages, --timeout flags

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
@alexvcodesphere alexvcodesphere requested a review from a team as a code owner February 20, 2026 18:34
@alexvcodesphere alexvcodesphere changed the title feat(cli): add cs deploy github command for PR deployments feat(cli): [3/3] add cs deploy github command for PR deployments Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant