Skip to content

fix(deploy): run PurgeCSS in the Pages deploy workflow - #53

Merged
jansroka merged 1 commit into
mainfrom
fix/deploy-purge-css
Nov 19, 2026
Merged

jansroka merged 1 commit into
mainfrom
fix/deploy-purge-css

Conversation

@jansroka

Copy link
Copy Markdown
Contributor

The deploy workflow never ran PurgeCSS, so the live site ships the full Webflow CSS while CI validates the purged version.

Problem

ci.yml runs npm run purge-css on _site/ before html-proofer. jekyll.yml, which builds what GitHub Pages serves, only runs jekyll build. The live https://www.inoeg.de/assets/css/inog-website.webflow.css is 129,834 bytes, byte-for-byte the source size. Purged, it is 36,516 bytes (-72%). The intent in d3d9a88 was for production to ship the purged CSS, and memory/finding-unused-assets.md claimed it already did.

Change

  • jekyll.yml: add the same setup-node (Node 24, npm cache), npm ci and npm run purge-css steps as ci.yml, after the Jekyll build and before the artifact upload.
  • memory/: correct both notes to match.

Verification

The risk is a class used on some page being purged, which html-proofer cannot detect. I ran a headless-Chrome comparison of main's build, unpurged (what is live today) against purged, on all 8 non-redirect pages, in 3 views each (1440 px desktop, 390 px mobile, 390 px with the mobile menu opened):

  • Per element and ::before/::after: bounding box and 21 computed properties (display, colors, fonts, margins, padding, sizes, transforms, ...). 0 differences in 24 of 24 views.
  • document.body.scrollHeight: identical in 24 of 24 views.
  • Full-page screenshots: byte-equal in 23 of 24. The exception, /projekte/ with the menu open, also flaps when the unpurged site is compared against itself (1 of 3 runs), and was equal in 3 of 3 reruns against purged. It is screenshot timing, not CSS.
  • Negative control: the same comparer flags a copy with one injected padding-top: 3px rule on every view of the pages that load it.

Not done

  • :hover/:focus states were not exercised. PurgeCSS keeps pseudo-class rules whose base selector survives, and the comparison shows every base selector's styles intact.
  • The deploy job does not run html-proofer. CI already gates PRs on the same build plus purge.

Risk

None. No auth, authorization, tenancy, billing or cryptography code is touched. This changes the production CSS of the public site on merge.

Skills used

  • dependabot-sweep: the repo sweep that surfaced this bug.
  • step-back: verified the premise (workflow source plus live file size) before planning the fix.

ci.yml purges _site/ CSS before html-proofer, but jekyll.yml never did, so the live site shipped the full Webflow CSS (live inog-website.webflow.css was 129,834 bytes, identical to source) while CI validated the purged output. Add the same setup-node, npm ci and purge-css steps to the deploy build.

Also correct the repo memory notes that claimed production CSS was already purged.
@jansroka
jansroka merged commit 5d0b2c3 into main Nov 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant