Skip to content

feat(cli): add cs deploy github command for PR deployments#178

Draft
alexvcodesphere wants to merge 1 commit intocodesphere-cloud:mainfrom
alexvcodesphere:feat/cli-preview-command
Draft

feat(cli): add cs deploy github command for PR deployments#178
alexvcodesphere wants to merge 1 commit intocodesphere-cloud:mainfrom
alexvcodesphere:feat/cli-preview-command

Conversation

@alexvcodesphere
Copy link
Member

@alexvcodesphere alexvcodesphere commented Feb 20, 2026

Summary

Refactors the standalone gh-action-deploy binary into two layers within the CLI:

  • pkg/deploy/ — generic, provider-agnostic deployment engine (find, create, update, delete workspace + run pipeline)
  • cli/cmd/deploy_github.go — GitHub-specific cs deploy github subcommand that reads GitHub Actions env vars and delegates to pkg/deploy

New Commands

cs deploy          # parent command for CI/CD deployments
cs deploy github   # GitHub Actions integration

Files Changed

File Change
pkg/deploy/deploy.go Generic deployment engine
pkg/deploy/mocks.go Generated mock for deploy.Client
pkg/deploy/deploy_test.go Ginkgo/Gomega tests for Deployer
pkg/deploy/deploy_suite_test.go Ginkgo suite bootstrap
cli/cmd/deploy.go cs deploy parent command
cli/cmd/deploy_github.go cs deploy github subcommand
cli/cmd/root.go Added AddDeployCmd registration
.mockery.yml Added pkg/deploy for mock generation

Design

The generic engine in pkg/deploy/ can be reused by future providers (e.g. cs deploy gitlab, cs deploy bitbucket).

The GitHub subcommand auto-detects PR context from standard GitHub Actions environment variables (GITHUB_EVENT_NAME, GITHUB_HEAD_REF, GITHUB_REPOSITORY, etc.) and creates, updates, or deletes workspaces accordingly.

Verification

  • go fmt
  • make lint ✅ — 0 issues
  • make build
  • make test ✅ — all pass including new pkg/deploy tests
  • cs deploy --help
  • cs deploy github --help

@alexvcodesphere alexvcodesphere requested a review from a team as a code owner February 20, 2026 15:04
@alexvcodesphere alexvcodesphere force-pushed the feat/cli-preview-command branch 2 times, most recently from 28ebe7b to 8c13a29 Compare February 20, 2026 15:17
Refactor the standalone gh-action-deploy binary into two layers:

- pkg/deploy/: generic, provider-agnostic deployment engine
  (find, create, update, delete workspace + run pipeline)
- cli/cmd/deploy_github.go: GitHub-specific subcommand that reads
  GitHub Actions env vars and delegates to pkg/deploy

New commands:
  cs deploy          - parent command for CI/CD deployments
  cs deploy github   - GitHub Actions integration

The generic engine in pkg/deploy/ can be reused by future providers
(e.g. cs deploy gitlab).

Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
@alexvcodesphere alexvcodesphere force-pushed the feat/cli-preview-command branch from 8c13a29 to e780a86 Compare February 20, 2026 16:22
@alexvcodesphere alexvcodesphere changed the title feat(cli): add cs preview github command for PR preview environments feat(cli): add cs deploy github command for PR deployments Feb 20, 2026
@alexvcodesphere alexvcodesphere marked this pull request as draft February 20, 2026 18:35
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