cicd

package
v0.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	PreviewWorkflowPath        = ".github/workflows/preview.yml"
	PreviewCleanupWorkflowPath = ".github/workflows/preview-cleanup.yml"
)

PreviewWorkflowPath and PreviewCleanupWorkflowPath are repo-relative.

View Source
const CLIVersion = "v0.15.1"

CLIVersion pins the nextdeploy CLI installed in CI. Bump on release; keep in sync with .release-please-manifest.json.

Pinning rather than @latest is deliberate: @latest recompiles on every run and silently picks up breaking releases, so a deploy that worked yesterday can fail today with no change to the repo.

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL