Skip to main content
Push the current branch to the remote repository, with built-in preflight safety checks.

Usage

dex deploy [--remote origin] [--no-set-upstream] [--no-preflight] [--preflight-env test|prod]

Flags

—remote

Specify the git remote name.
dex deploy --remote origin
Default: origin

—no-set-upstream

Disable automatic upstream branch configuration.
dex deploy --no-set-upstream
By default, if the current branch does not have an upstream, dex deploy runs:
git push --set-upstream <remote> <branch>
Use --no-set-upstream to skip this and require manual upstream configuration.

—no-preflight

Emergency use only. Bypasses all preflight safety checks. Do NOT use for production deploys.
Skip preflight validation before pushing.
dex deploy --no-preflight
Recommended: Always run preflight checks before production deploys.

—preflight-env

Specify the environment for preflight checks.
dex deploy --preflight-env prod
Options:
  • test - Run preflight for test environment (default)
  • prod - Run preflight for production environment
Preflight checks validate entry audits, protected asset coverage, catalog integrity, and generated HTML security.

What preflight checks

When --no-preflight is NOT set, dex deploy runs:
  1. Entry runtime audit - Validates all non-legacy entries for data integrity
  2. Protected asset coverage - Ensures all active catalog lookups have asset mappings
  3. Catalog validation - Checks catalog manifest for structural issues
  4. Generated HTML security - Runs scripts/verify-generated-html.mjs to detect unsafe patterns
If any check fails, the deploy is blocked.

Deploy behavior

After preflight passes, dex deploy runs:
git push [--set-upstream <remote> <branch>]
Safety checks before push:
  • Verifies current directory is a git repository
  • Ensures not in detached HEAD state
  • Resolves current branch name

Production deploy (safest)

dex deploy --preflight-env prod
This runs full preflight validation against production constraints before pushing.

Test deploy

dex deploy --preflight-env test
or simply:
dex deploy
(Test is the default preflight environment.)

Emergency bypass

Only use --no-preflight in emergency scenarios with explicit approval. This bypasses all safety checks.
dex deploy --no-preflight

Examples

Deploy to origin with production preflight

dex deploy --preflight-env prod

Deploy to custom remote

dex deploy --remote upstream

Deploy without setting upstream

dex deploy --no-set-upstream

Emergency deploy (skip preflight)

dex deploy --no-preflight

Error handling

Deploy fails if:
  • Not inside a git repository
  • In detached HEAD state
  • Preflight checks fail (unless --no-preflight)
  • Git push fails (network, permissions, conflicts)

Integration with release workflow

For coordinated content + infrastructure deploys, use the full release workflow:
1

Validate and publish content

dex release preflight --env prod
dex release publish --env prod
2

Deploy site

dex deploy --preflight-env prod
See dex release for coordinated publishing.

High-risk flags policy

dex deploy --no-preflight is classified as emergency-only under the Dex high-risk flags policy.Production deploys should ALWAYS use --preflight-env prod.

dex release

Full release workflow with preflight

dex setup

Configure workspace repository paths

Build docs developers (and LLMs) love