Skip to content

feat(action): add deploy-helm-preview composite action#114

Draft
kriscoleman wants to merge 2 commits into
mainfrom
feat/deploy-helm-preview
Draft

feat(action): add deploy-helm-preview composite action#114
kriscoleman wants to merge 2 commits into
mainfrom
feat/deploy-helm-preview

Conversation

@kriscoleman

Copy link
Copy Markdown
Member

Summary

  • Adds a new composite action deploy-helm-preview that manages ephemeral Helm preview environments on Replicated CMX clusters for pull requests
  • Implements the full deploy lifecycle: sticky PR comment → GitHub deployment creation → cluster create-or-reuse (with TTL extension) → port exposure → kubeconfig fetch → helm upgrade --install --wait → success/failure status updates
  • Implements teardown mode (triggered on PR close) that removes the cluster and posts a final ⬛ comment
  • Uses marocchino/sticky-pull-request-comment@v2 with header cmx-helm-preview to avoid conflicts with other actions
  • Uses gh api for GitHub deployment status tracking with environment URLs
  • Composes existing create-cluster, expose-port, and remove-cluster actions from this repo; inlines helm CLI commands directly (since helm-install is a node24 action and needs kubeconfig as a file, not inline)

Inputs

Input Default Notes
replicated-api-token required
chart OCI URL, required
chart-version required
release-name required
namespace default
values inline YAML, mutually exclusive with values-file
values-file path to file
cluster-name required, e.g. pr-123
cluster-distribution k3s
cluster-version 1.32
cluster-ttl 24h
port 443
github-token required, needs deployments:write + pull-requests:write
pr-number required
environment-prefix pr
teardown false set true on PR close
cluster-id required when teardown=true

Outputs

  • cluster-id — the CMX cluster ID
  • cluster-hostname — the ingress hostname from expose-port

Test plan

  • Review deploy-helm-preview/action.yml for correctness of step conditionals (teardown != 'true' vs teardown == 'true')
  • Verify create-cluster / expose-port / remove-cluster action refs use the correct tag (@v1)
  • Validate the cluster-id output expression covers both create and reuse paths
  • Confirm marocchino/sticky-pull-request-comment@v2 input naming matches the action's actual interface
  • Wire up in a test repo workflow and run against a real PR to exercise the full deploy + teardown flow
  • Decide strategy for persisting cluster-id between deploy and teardown jobs (artifact, repo variable, or environment)

🤖 Generated with Claude Code

Composite action that manages ephemeral Helm preview environments on
Replicated CMX clusters for pull requests. Handles the full deploy
lifecycle: sticky PR comment, GitHub deployment status, cluster
create-or-reuse, port exposure, kubeconfig fetch, helm upgrade --install,
and success/failure status updates. Teardown mode removes the cluster
and posts a final torn-down comment.
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