Conversation
Deploying action with ⚡ PullPreview
|
Deploying action with ⚡ PullPreview
|
There was a problem hiding this comment.
Pull request overview
Adds first-class Helm (k3s) deployment support (Hetzner-only) alongside the existing Docker Compose flow, including new CLI/action inputs, validation, and a dedicated Helm smoke workflow.
Changes:
- Introduce
deployment_target(compose/helm) with Helm chart inputs and validation (chart, repo, values, set). - Implement Helm deployment flow (sync app tree when needed, helm upgrade/install, Caddy gateway manifest, failure diagnostics).
- Expand CI/docs/action surface area to exercise and document Helm deployments.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/pullpreview/up.go | Validates deployment config early; prints Helm-specific log tailing instructions. |
| internal/pullpreview/types.go | Adds DeploymentTarget type and new Helm-related fields to option structs. |
| internal/pullpreview/instance_test.go | Adds tests for Helm port behavior and SSH non-interactive options. |
| internal/pullpreview/instance.go | Adds deployment target + Helm fields, config validation, SSH arg refactor, Helm deploy routing. |
| internal/pullpreview/github_sync.go | Persists deployment target + Helm chart fields when rebuilding common options. |
| internal/pullpreview/deployment_target.go | Adds normalization/validation helpers for deployment target. |
| internal/pullpreview/deploy_helm.go | Implements Helm deployment (chart resolution, values expansion/sync, k3s deploy script, diagnostics). |
| internal/pullpreview/deploy_helm_test.go | Adds unit tests for Helm config validation, placeholder expansion, chart/value handling, deployment script generation. |
| internal/pullpreview/deploy_context.go | Extends remote env to include deployment target + namespace/release name; avoids COMPOSE_FILE for Helm. |
| internal/providers/hetzner/hetzner_test.go | Adds Helm userdata assertions; adjusts SSH retry test to account for cert-based SSH checks. |
| internal/providers/hetzner/hetzner.go | Adds Helm userdata branch (k3s + helm install) and validates cert-based SSH access before deleting temp key. |
| cmd/pullpreview/main_test.go | Adds CLI flag parsing tests for Helm-related flags and deployment target default/normalization. |
| cmd/pullpreview/main.go | Adds CLI flags for provider/deployment target and Helm chart inputs; propagates provider name into provider creation. |
| action.yml | Adds action inputs for deployment target + Helm chart settings and wires them into github-sync. |
| README.md | Documents Helm support, new inputs, and provides a Hetzner Helm workflow example. |
| .github/workflows/pullpreview-helm.yml | Adds scheduled/PR Helm smoke workflow with deploy + redeploy assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fs.StringVar(&values.admins, "admins", "", "Logins of GitHub users that will have their SSH key installed on the instance") | ||
| fs.StringVar(&values.cidrs, "cidrs", "0.0.0.0/0", "CIDRs allowed to connect to the instance") | ||
| fs.StringVar(&values.registries, "registries", "", "URIs of docker registries to authenticate against") | ||
| fs.StringVar((*string)(&values.options.DeploymentTarget), "deployment-target", string(pullpreview.DeploymentTargetCompose), "Deployment target to use: compose or helm") |
There was a problem hiding this comment.
deployment-target flag registration attempts to pass &values.options.DeploymentTarget (a pullpreview.DeploymentTarget) as a *string to flag.StringVar, which does not compile (cannot convert *DeploymentTarget to *string). Use a separate string field for the raw flag value (or implement flag.Value) and normalize/convert it into opts.DeploymentTarget in ToOptions().
Deploying action with ⚡ PullPreview
|
Deploying action with ⚡ PullPreview
|
Deploying action with ⚡ PullPreview
|
Deploying action with ⚡ PullPreview
|
Deploying action with ⚡ PullPreview
|
Deploying action with ⚡ PullPreview
|
Summary
deployment_targetsupport alongside the existing Compose path, withcomposeremaining the default andhelmadded as a first-pass Hetzner-only targetdeployment_target=helm, deploy one Helm release into one namespace per preview, and keep the existing single preview URL model through a PullPreview-managed Caddy gateway--setoverrides, including placeholder expansion for{{ pullpreview_url }},{{ pullpreview_public_dns }},{{ pullpreview_public_ip }},{{ namespace }}, and{{ release_name }}pullpreview_helmworkflow using thepullpreview-helmlabel, with sequential deploy and redeploy smoke coverage on Hetznerpullpreview_labelinstance tag sopullpreview,pullpreview-helm, and other custom labels do not clean up each other's instancesdist/and expand the README with Helm deployment notes plus a full action outputs tableSupported Inputs
These are the action inputs currently supported by
action.ymland documented in the README.app_path.${{ github.workspace }}.dnsmy.preview.runmax_domain_length62labelpullpreviewgithub_token${{ github.token }}admins@collaborators/pushports80/tcp,443/tcp22is always open.cidrs0.0.0.0/0default_port80deployment_targetcomposecomposeorhelm.helmis Hetzner-only in this pass.compose_filesdocker-compose.ymldocker composewhendeployment_target=compose.compose_options--builddocker compose upoptions whendeployment_target=compose.chart""deployment_target=helm.chart_repository""chartwhendeployment_target=helm.chart_values""app_pathwhendeployment_target=helm.chart_set""--setoverrides whendeployment_target=helm.license""instance_typesmallregion""imageubuntu-24.04deployment_variant""providerlightsaillightsailorhetzner.registries""proxy_tls""service:port). Required fordeployment_target=helm.pre_script""ttlinfiniteSupported Outputs
These are the action outputs currently supported by
action.ymland documented in the README.livetruewhen the run produced or updated a live preview deployment, otherwisefalse.urlproxy_tls, this is HTTPS on port443.hostusernameVerification
mise exec -- go test ./...