Skip to content

ci: split the Pages deploy into a v3 deploy.yml gated by workflow_run - #236

Merged
danielvm-git merged 1 commit into
mainfrom
ci/v3-deploy-split
Nov 8, 2026
Merged

danielvm-git merged 1 commit into
mainfrom
ci/v3-deploy-split

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

Summary

Resolves the CI/CD Migration Status failure: the repo was still on the v2 single-file shape, with the Pages build and deploy embedded in test-build-release.yml.

Now it is the v3 pair:

File Role
test-build-release.yml every gate job + the release job
deploy.yml Pages build → artifact → deploy, triggered by workflow_run

The gate is preserved, deliberately

deploy.yml only starts when the pipeline concluded successfully on main:

on:
  workflow_run:
    workflows: ["Test Build Release"]
    types: [completed]
# job condition
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main'

This is the property BUG-2026-10-25-pages-not-gated was opened for: a red gate must never publish. workflow_run + conclusion == 'success' enforces it at least as strongly as the old needs: edge.

Contract test updated to encode the invariant, not the layout

scripts/test-ci-pipeline-contract.sh rule 6 previously hard-coded "the deploy must live in the pipeline" and had a self-test asserting "Pages deploy in a separate workflow fails" — it would have rejected this migration. It now states the real rule:

  • a Pages deploy may live in the pipeline, needing every gate job; or
  • in deploy.yml, gated through the deploy's needs: chain by a successful run on main;
  • an ungated deploy in any other file still fails.

Anti-vacuity improved while doing it: three new fixtures cover the v3 shapes, and expect() now treats a checker crash as a failure — previously a traceback exited non-zero and silently satisfied an expect ... fail case, which is how a real bug (on: push being a string) stayed hidden during this change.

One deliberate behaviour change

The docs-change paths-filter is dropped. It compared against github.ref, which does not exist in a workflow_run payload, and a filter that can silently skip a needed deploy is worse than rebuilding the site on each successful main push.

Verify

  • bash scripts/test-ci-pipeline-contract.sh — OK on the real workflows
  • bash scripts/test-ci-pipeline-contract.sh --self-test — 15/15 fixtures, no crashes
  • npm run compliance — exit 0
  • bash scripts/run-verification-gates.sh — 63/63 deterministic, PASS
  • Generated-artifact drift step — exit 0
  • wire-ci freshness probe (workflows: ["Test Build Release"]) matches
  • Every job keeps timeout-minutes; every action stays SHA-pinned; deploy keeps the retry ladder, github-pages environment and smoke test

Files

  • .github/workflows/deploy.yml (new)
  • .github/workflows/test-build-release.yml
  • scripts/test-ci-pipeline-contract.sh

The v3 CI/CD workflow pair is test-build-release.yml plus a separate deploy.yml
triggered by workflow_run. This repo had the Pages build and deploy embedded in
the pipeline, so the migration check reported "deploy is only embedded in a
single file".

- deploy.yml owns the Pages build and deploy. Its workflow_run trigger on
  "Test Build Release" plus conclusion == 'success' && head_branch == 'main' is
  the gate, so a red pipeline still cannot publish
  (BUG-2026-10-25-pages-not-gated stays fixed). The deploy job keeps the retry
  ladder, the github-pages environment and the post-deploy smoke test.
- test-build-release.yml keeps the gates and the release job only.
- The docs-change paths filter is dropped: it compared against
  github.ref, which does not exist in a workflow_run payload, and a filter that
  silently skips a needed deploy is worse than rebuilding the site each push.
- test-ci-pipeline-contract.sh rule 6 now encodes the invariant instead of the
  layout: a Pages deploy may live in the pipeline (needing every gate) or in
  deploy.yml (gated through the deploy's needs: chain by a successful run), and
  an ungated deploy anywhere still fails. The self-test gains three fixtures for
  the v3 shapes and now treats a checker crash as a failure rather than letting
  it satisfy an "expect fail" case.
@danielvm-git
danielvm-git merged commit f41e760 into main Nov 8, 2026
5 checks passed
@danielvm-git
danielvm-git deleted the ci/v3-deploy-split branch November 8, 2026 11:46
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.95.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant