Production
Site CI and the dependency pipeline
On this page
Every site repository (Avunu/site-<slug>) runs the same three workflows, thin
callers of wordpress-nix's reusable ones, pinned to the wordpress-nix revision
the site's flake.lock locks. wordpress-nix sync (or wordpress-init
--sync) writes them; nobody edits them by hand.
| Site workflow | Calls | Runs on |
|---|---|---|
.github/workflows/ci.yml | site-ci.yml | every pull request, every push to main |
.github/workflows/deps.yml | site-deps.yml | every pull request (it acts on Dependabot's), pushes to main, every 6 hours |
.github/workflows/audit.yml | site-audit.yml | daily and weekly |
The managed files
A site opts in with wordpress-nix.toml:
[tool.wordpress-nix]
schema = 1
profile = "deployment" # the wordpress-site profile, deployment@1.0
[tool.wordpress-nix.site]
home-url = "https://example.org"
# woocommerce = true # default: whether composer.lock locks wp-plugin/woocommerce
# drop-plugins = ["mainwp-child/mainwp-child.php"]
# local-upload-prefixes = ["cwicly", "fonts", "wpcodebox", "fluentform"]deployment@1.0 is wordpress-nix's built-in profile for a site, a deployment
project in python-devops-nix's terms: everything recommended has except a
release flow. Its files:
| File | Module | What |
|---|---|---|
.github/dependabot.yml | dependabot | Composer daily (a time between 02<00>00> and 05<59>59> hashed from the slug), grouped wordpress-core, wp-plugins, avunu, php-libs; cooldown 7 days, 1 for patches, none for core; github-actions weekly, ignoring wordpress-nix's own workflows |
.github/workflows/{ci,deps,audit}.yml | ci | the callers above |
.github/wordpress-nix.json | site | the site's facts (slug, woocommerce, homeUrl, dropPlugins, localUploadPrefixes), which the workflows, the decision table and the data commands read without Python |
.editorconfig | editorconfig | 4 spaces for PHP, 2 for the rest |
.pre-commit-config.yaml | lint | no dumps, auth.json or .env in git; php -l; committed's message check |
committed.toml | commits | conventional commits |
.gitignore, the site block at its end | dev-shell | never committed: auth.json, .env, dumps; always built: /vendor, web/wp, uploads. Bedrock's own lines above it stay, plugin and theme wildcards included: the block goes last, so a wildcard in it would re-ignore the premium code the # BEGIN wordpress-nix lines un-ignore |
repo-policy makes main require ci / flake, ci / smoke and ci / audit,
with no required approval (Dependabot's pull requests must merge with no person
in the loop), squash merges only.
The gates (site-ci.yml)
| Check | Runner | What |
|---|---|---|
ci / flake | [self-hosted, nixos] | every check of the site flake but smoke: composer-validate, vendor-hash, build and any the site adds; no tracked *.sql, auth.json or .env. On a push to main, the vendor tree is uploaded to the cache |
ci / smoke | [self-hosted, linux, x64, kvm] | checks.smoke: the package in a NixOS VM with MariaDB; wp core install, every plugin activated, the theme, /, /wp/wp-login.php, /wp-json/; a read-only code tree; PHP under uploads refused; no PHP warning or permission error |
ci / audit | [self-hosted, nixos], networked steps | composer audit --locked --no-dev; nix run .#verify-wp-checksums; nix run .#wordpress-nix -- audit --base-rev <merge-base> (Wordfence: only what the change introduces fails) |
ci / premium-diff | [self-hosted, nixos] | advisory: warnings on eval, base64_decode, gzinflate, create_function, assert($…), outbound PHP URLs and long opaque strings that a change adds to committed code |
A pull request from a fork runs on ubuntu-latest.
A Composer pull request, end to end (site-deps.yml)
Dependabot opens
fix(deps): bump the wp-plugins group …, changingcomposer.jsonandcomposer.lock.disarmturns off any auto-merge an earlier head enabled.relock-plan(the caller's runner, no write token) runsnix run .#relockon the PR's head and uploads the patch.relock-push(ubuntu-latest) installs wordpress-nix-tools from the integration branch's pinned wordpress-nix, hash-locked, then, before the App's token exists:wordpress-nix ci apply-relock-patch: the patch touchesnix/vendor-hashonly, a regular file;wordpress-nix ci verify-relockagainst the PR's merge-base (below);wordpress-nix ci verdict, the decision table.
It pushes
chore(deps): relock vendor hash [dependabot skip]with the App's token, and enables auto-merge for that commit only when the lock isokand the verdict isrelock. Otherwise the PR is labelledneeds-reviewwith auto-merge off.CI runs on the new head (an App's push starts it): flake, smoke, audit.
GitHub merges it once the required checks pass. The merge, made by the App, pushes to
main, whoseci / flakeuploads the vendor tree to the cache.The cluster's Worker dispatches
flake-update.ymlin cluster-ovh-01 (see Releases and the cluster).
A github-actions PR needs no relock: auto-merge enables auto-merge (third-party
actions) or closes it (wordpress-nix's own workflows, which move only through
the rollout). hold turns auto-merge off on any head no job reached a verdict on.
verify-relock: the URL names the same package and version
frappe-nix's rule, never a host allowlist. For every package composer.lock adds or changes:
| Package | Its dist.url must be |
|---|---|
wp-plugin/<s>, wp-theme/<s> | https://downloads.wordpress.org/{plugin,theme}/<s>.<version>.zip (and the svn source wordpress.org's for <s>) |
roots/wordpress-no-content | https://downloads.w.org/release/wordpress-<version>-no-content.zip (or the same path on downloads.wordpress.org), with the lock's shasum |
| anything else (Packagist) | https://api.github.com/repos/<o>/<r>/zipball/<ref> or https://codeload.github.com/<o>/<r>/legacy.zip/<ref>, where <o>/<r> is source.url's and <ref> is source.reference |
A mismatch is a reject: nothing is pushed and the PR is held. That is a
wordpress.org or core URL naming another slug, version or host, a core dist
without its shasum, or a Packagist package from GitHub whose dist is not its
source's own zipball (another owner, repository, reference or host). A
Packagist package not on GitHub at all (its source on GitLab or Bitbucket, a path or artifact dist) is another host, which plan §4.4 sends to needs-review: the relock is pushed, CI runs on the real change, and a person
reads it. So is a package the lock adds or removes. nix/vendor-hash must be
one SRI hash, never lib.fakeHash.
It also gives the §6.4 rows the version change decides, read from the base's and
the head's versions (the first number major, the second minor), as needs-review: a roots/wordpress* minor or major, any major, and a wp-plugin/woocommerce* minor where the head's .github/wordpress-nix.json says woocommerce: true.
The decision table
Every Composer PR is relocked (verify_relock then gives the rows the version
change decides, above), so a major is reviewed on a head whose vendor hash is
current rather than failing ci / flake on a stale one.
| Change | Verdict |
|---|---|
roots/wordpress* patch | relock, then auto (no cooldown) |
roots/wordpress* minor or major | relock, then review (until previews smoke-test it) |
| any major | relock, then review |
wp-plugins group, minor or patch | relock, then auto |
wp-plugin/woocommerce* minor on a site whose woocommerce is true | relock, then review |
php-libs group, minor or patch | relock, then auto |
avunu/* | relock, then auto |
| a new or removed package, a package off GitHub | relock, then review |
a verify-relock reject | held: nothing is pushed |
github-actions, Avunu/wordpress* | close (moves through the rollout) |
| github-actions, other | auto |
Auto-merge still waits for every required check. A vulnerability fix is an
operator's: composer update wp-plugin/<x> and nix run .#relock on a security/<x> branch, which bypasses Dependabot's cooldown; every gate applies.
The scheduled audits (site-audit.yml)
| Job | When | What |
|---|---|---|
vulnerabilities | daily | wordpress-nix audit; one issue, Vulnerable packages (label security), updated while there are findings, closed when there are none |
vendor-rebuild | weekly | nix build --rebuild .#vendor; a mismatch under an unchanged lock opens Vendor hash drift (security). Never relock it: a registry served different bytes for a locked version |
cluster-compat | daily, not required | the site built with the wordpress-nix and nixpkgs cluster-ovh-01 pins (--override-input), read from its flake.lock with the App's token on a hosted runner |
Secrets, variables, runners
Named per the frappe-nix contract. wordpress-nix repo apply provisions them; APP_ID, APP_PRIVATE_KEY, WORDPRESS_NIX_CACHE_READ_TOKEN and WORDFENCE_API_KEY are both org Actions secrets and org Dependabot secrets,
scoped to site-* repositories: a run on Dependabot's own head sees only
Dependabot secrets, a run on an App-pushed head only Actions secrets.
| Name | Kind | Used by |
|---|---|---|
APP_ID, APP_PRIVATE_KEY | secret (Actions + Dependabot) | relock-push, auto-merge, update-branches; site-audit's cluster read |
WORDPRESS_NIX_CACHE_READ_TOKEN | secret (Actions + Dependabot) | every nix job |
WORDPRESS_NIX_CACHE_TOKEN | secret (Actions only) | ci / flake on a push to main |
WORDFENCE_API_KEY | secret (Actions + Dependabot) | ci / audit, vulnerabilities (as wordpress-nix audit's WORDPRESS_NIX_WORDFENCE_KEY) |
WORDPRESS_NIX_CACHE | variable | cachix:<name> before the cluster is live, then attic:<endpoint>/<cache> |
Runners are nixos-dev-host's org runners: [self-hosted, nixos] for the
sandboxed checks and the audits, [self-hosted, linux, x64, kvm] for the smoke
VM. Never a production node. Every job that can hold the App's key runs on ubuntu-latest.
The fixture site (M5a)
Avunu/site-fixture proves the pipeline before any real site depends on it. It
holds no licensed code, and uses a private Cachix cache through WORDPRESS_NIX_CACHE until the cluster's Attic is live. Its content is the
template's output:
nix flake new -t github:Avunu/wordpress site-fixture && cd site-fixture
sed -i 's/name = "changeme";/name = "fixture";/' flake.nix
git init -b main && git remote add origin git@github.com:Avunu/site-fixture.git
git add -A && nix flake lock
nix run .#wordpress-nix -- sync --write # the callers, pinned to the locked wordpress-nix
nix run .#relock && nix flake check --no-pure-eval
git add -A && git commit -m "feat: the fixture site"Then, by hand (M5a's exit criteria in the v3 plan):
Create the private repository and push; run
wordpress-nix repo apply(auto-merge, squash only, themainruleset requiring the three gates, secret scanning) and provision the secrets and the variable above.Make sure the org runners carry the
nixosandkvmlabels.Wait for Dependabot's first Composer PR, or pin an older
wp-plugin/*to provoke one; it must relock, auto-merge and upload to the cache with no person acting. Likewise a github-actions PR and aphp-libsgroup PR.Refusals: push a branch whose
composer.locknames a foreign dist host for awp-plugin/*, and one whose Packagist dist owner differs from its source;verify-relockmust refuse both (selftest-scaffold covers the first offline of GitHub).Lock a known-vulnerable plugin version:
ci / auditfails on the PR, andsite-audit's daily run opens the Vulnerable packages issue.Settle whether Dependabot needs a credential-less
registries:entry for WP Packages.