cicd

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 2 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 = "v1.2.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.

View Source
const GitLabWorkflowPath = ".gitlab-ci.yml"

GitLabWorkflowPath is the default location for GitLab CI/CD configuration.

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(knownTarget ...string) string

RenderDeployWorkflow returns the YAML for WorkflowPath.

The workflow knows the deployment type from nextdeploy CLI and nextdeploy.yml at runtime, while also supporting an explicit target type passed at generation time.

Note: Application secrets (including Hyperdrive origin_env URLs) are intentionally not wired here — `nextdeploy apply` resolves origin_env from the shell env or NextDeploy's configured secret store.

func RenderGitLabCIWorkflow added in v1.0.0

func RenderGitLabCIWorkflow(knownTarget ...string) string

RenderGitLabCIWorkflow returns the YAML for GitLabWorkflowPath.

The workflow knows the deployment type from nextdeploy CLI and nextdeploy.yml at runtime, while also supporting an explicit target type passed at generation time.

Secret Handling (Doppler-first):

  • If DOPPLER_TOKEN is configured in GitLab CI/CD Variables, NextDeploy will automatically install the Doppler CLI and run with `doppler run --`, streaming secrets directly in memory.
  • If DOPPLER_TOKEN is not provided, NextDeploy falls back to standard GitLab CI/CD variables (e.g. CLOUDFLARE_API_TOKEN, AWS_ACCESS_KEY_ID, SSH_PRIVATE_KEY).

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