CI/CD and workflow behavior
All workflows live under .github/workflows/. This page summarizes behavior; inline workflow comments and the workflows README are authoritative for details.
Pull requests (pr.yml)
Triggers: Every pull_request event.
Concurrency: One run per PR; newer commits cancel in-progress runs for that PR.
Typical steps:
- Labeler — Applies labels from
.github/labeler.ymlbased on changed paths. - Install — pnpm and Node (see workflow for versions),
pnpm install, rootcomposer install. - Lint — Full monorepo lint: PHP, JS, CSS, Markdown,
package.json. - Playwright — Browser dependencies installed for e2e.
- Build —
npx nx affected --base="origin/<base_branch>" -t buildso only affected projects build. - Tests —
nx affectedfortest-e2eandtest-integrationthe same way. - Artifacts — Playwright report uploaded on completion (unless cancelled).
Screenshot / visual regression targets exist but may be disabled in YAML until snapshot stability and bot commits are agreed.
How “affected” is chosen
The PR workflow compares the PR head to origin/<github.base_ref> (the target branch, usually main). Any project touched or implied by the Nx graph runs the expensive targets.
Reusable workflow detect-affected-projects.yml exists for callable workflows; it computes affected app projects for a given base/head. Keep it in mind if you add new workflows that need the same logic.
Merges to main
- Docs: Pushes to
mainthat touchdocs/**, packagedocs/**, sync script, or docs workflow deploy the VitePress site viadeploy-docs.yml(see Documentation site). - Releases: Merging code does not by itself publish plugin/theme zip artifacts. Publishing is tag-driven (
tag.yml).
Tags (tag.yml)
Triggers: Push of tags matching **/v* (for example bcgov-wordpress-blocks/v1.2.0).
Behavior (high level):
- Checkout with full history.
- Parse tag into project name (Nx project) and version.
nx run <project>:composer-installandnx run <project>:build.- Create
dist.zipfrom the project directory usinggit archiveafter stagingdist/(respects.gitattributesexport rules). - Create a GitHub Release with
dist.zipattached. - Update
packages.jsonfor the Composer repository hosted on GitHub Pages and deploy thepublic/output.
See Release and deployment for the consumer-facing model.
Permissions
Workflows use least privilege where possible; tag.yml and docs deploy require contents: write (and Pages-related permissions) for releases and gh-pages updates.