Documentation
¶
Overview ¶
Package cicd renders the GitHub Actions deploy workflow. It is the single source of truth for both `nextdeploy generate-ci` and the scaffolder, so the two can never drift — previously each shipped its own file (different runtime, different install step, different secrets), and a user who ran both `init` and `generate-ci` got two workflows and two deploys per push.
Index ¶
Constants ¶
const ( PreviewWorkflowPath = ".github/workflows/preview.yml" PreviewCleanupWorkflowPath = ".github/workflows/preview-cleanup.yml" )
PreviewWorkflowPath and PreviewCleanupWorkflowPath are repo-relative.
const CLIVersion = "v0.20.1" // {x-release-please-version}
CLIVersion pins the nextdeploy CLI installed in CI. Bump on release; keep in sync with .release-please-manifest.json.
The generated workflows download this release's prebuilt binary and verify its checksum. release-please updates this pin from the package manifest.
const WorkflowPath = ".github/workflows/nextdeploy.yml"
WorkflowPath is where the rendered workflow is written, relative to the repository root. Both callers use it so a scaffolded app and `generate-ci` produce exactly one file.
Variables ¶
This section is empty.
Functions ¶
func RenderDeployWorkflow ¶
func RenderDeployWorkflow() string
RenderDeployWorkflow returns the YAML for WorkflowPath.
The workflow is TARGET-AWARE AT RUNTIME: a `detect` step reads nextdeploy.yml on the runner and runs the matching deploy (cloudflare | aws | vps). The renderer therefore takes no target parameter — one file works for every target and keeps working when the app is retargeted, without regenerating CI. `generate-ci` still resolves the target, but only to print which secrets the user needs to set.
func RenderPreviewCleanupWorkflow ¶
func RenderPreviewCleanupWorkflow() string
RenderPreviewCleanupWorkflow returns the YAML that destroys a PR's preview stack when the PR closes.
Always pair create with destroy: without this, every PR leaks a Worker and an R2 bucket until the account hits its limits. The `closed` trigger fires for both merge and plain close, so no stack is missed.
func RenderPreviewWorkflow ¶
func RenderPreviewWorkflow() string
RenderPreviewWorkflow returns the YAML that deploys a per-PR preview stack and comments its URL on the pull request.
Requires one extra repository secret beyond the normal Cloudflare pair: CLOUDFLARE_WORKERS_SUBDOMAIN — the account's workers.dev subdomain (the <x> in https://<worker>.<x>.workers.dev). It is a stable per-account value, set once.
Types ¶
This section is empty.