This document explains how to configure reliable production deployments using stack-tectonic compositions on the production branch.
When using orun run --changed on production branch pushes (e.g. after a squash merge to main), the change detection compares the merge commit against its parent. Because a squash merge produces a single commit whose parent is the previous main HEAD, and the new commit already includes all changes, --changed may resolve to zero changed components:
0 components x 3 envs -> 0 jobs
This produces a green CI run with zero deployments — a false positive that masks the absence of any live deployment.
Remove --changed from the production branch push step:
- name: Execute
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: orun runThis ensures every deployable component runs its production job on every push to main. For repos with fewer than 10 components, this adds minimal overhead.
If the repo has many components and full runs are expensive, pass explicit base/head refs:
- name: Execute
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: orun run --changed --base "${{ github.event.before }}" --head "${{ github.sha }}"Using github.event.before as the base ensures the diff covers the actual changes introduced by the merge.
Keep --changed for PR validation but add a dedicated production deploy step:
jobs:
deploy:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: sourceplane/orun-action@v1.1.0
- name: Deploy all production components
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: orun run --env productionDeployment is not gated inside the job steps. It is decided entirely by which execution profile
an environment subscribes to: a deploy only happens when the selected profile includes the
composition's deploy capability.
For cloudflare-pages, cloudflare-pages-turbo, cloudflare-worker, cloudflare-worker-turbo,
and cloudflare-workers-assets-turbo:
| Profile | What runs | Mutating? |
|---|---|---|
pull-request |
setup, install, structure/build verification | no |
verify |
pull-request plus deploy-dry-run where the composition has one |
no |
deploy |
the full pipeline through provision/deploy and smoke |
yes |
cloudflare-pages and cloudflare-pages-turbo have no deploy-dry-run capability, so their
verify lane stops at build-output verification. The cloudflare-worker* compositions do have one.
The Terraform-reconciled variants (cloudflare-pages-terraform, cloudflare-pages-turbo-terraform)
use the same shape with terraform-plan in verify and terraform-apply in release.
Guardrails come from profile policies rather than in-step branch checks. Every mutating profile in the catalog sets:
policies:
requireApproval: true
requireCleanGitTree: trueCredentials are still enforced at the step: deploy steps assert CLOUDFLARE_ACCOUNT_ID and
CLOUDFLARE_API_TOKEN are set and hard-fail when they are missing, rather than silently skipping.
The deployBranch parameter is not a gate — it is the branch name passed to
wrangler pages deploy --branch and to the Pages project's production_branch setting.
Bind the mutating profile only to the environment that should actually deploy:
spec:
type: cloudflare-pages-turbo
subscribe:
environments:
- name: preview
profile: pull-request
- name: staging
profile: verify
- name: production
profile: deployIf an environment names no profile, the composition's spec.defaultProfile applies — which is
verify for every Cloudflare composition in this catalog, i.e. non-mutating. An environment that
should deploy must say so explicitly.
Check the executed step list for the run, not just its colour. If the run for the production environment shows only the setup, install, build, and verification steps, the environment resolved a non-mutating profile and nothing was deployed.
A green run reporting 0 components x 3 envs -> 0 jobs means no deployment occurred. This is
never evidence of a successful deploy.
Before relying on production deploys:
- Set
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKENas GitHub repository secrets - Ensure your workflow passes these as environment variables to the
orun runstep - Subscribe the production environment to the composition's
deploy(orrelease) profile - Choose one of the patterns above for your production branch push behavior
- Replace
PLACEHOLDERdatabase IDs inwrangler.jsoncwith real resource IDs - If using D1, configure
migrationCommandin yourcomponent.yamlparameters - Optionally add
smokeCommandto verify the live endpoint after deploy