Environment variables
Set these in your CI provider’s secret management:
The CLI also auto-loads
.env* files before reading mdcms.config.ts. In CI, shell-exported variables from the env: block override values from files. Add --no-env-file to CLI commands, or set MDCMS_DOTENV=0, when the pipeline should rely only on CI-provided variables.
NODE_ENV only selects dotenv filenames such as .env.production. It is
separate from MDCMS_ENVIRONMENT, which selects the MDCMS content environment
targeted by schema sync, push, pull, and status commands.GitHub Actions: Schema sync
Automatically sync the schema to the server whenevermdcms.config.ts changes on the main branch.
.github/workflows/mdcms-schema-sync.yml
GitHub Actions: Content push
Push content changes to the server on every merge to main. The--force flag skips interactive prompts.
.github/workflows/mdcms-content-push.yml
Schema sync runs before content push to ensure the schema hash is available.
Push requires a valid schema hash from a prior sync.
Status check
Usemdcms status as a CI gate. The command exits with code 1 when drift is detected, making it suitable for blocking deployments.
Schema drift detection
Prevent deployments when the local schema definition has diverged from the server. This is useful as a pull request check to ensure schema changes are synced before merging..github/workflows/mdcms-drift-check.yml