From bc4ab215f4fd5ea78b0113a3f987373f58f51a30 Mon Sep 17 00:00:00 2001 From: John Owens Date: Sun, 30 Aug 2026 20:19:51 -0700 Subject: [PATCH] Fix the Jekyll CI workflows Two complementary bugs: the workflow that builds the site correctly cannot run on branches without failing, and the one that does run on branches does not build the site correctly. Deploy Jekyll site to Pages triggered on every push with no branch filter. GitHub Pages only accepts deployments from the configured source branch, so the deploy job failed on every feature branch - a guaranteed red X on every PR - while also parking those runs in the shared "pages" concurrency group alongside real main deploys. History: main succeeded 13 times, every feature branch failed. Now restricted to main. Test Jekyll Build built with `--source docs`, which is not how the site is assembled: _config.yml treats the repo root as the source and only points layouts_dir/includes_dir into docs/. Building from docs/ skipped the root-level assets/ directory, so assets/css/style.scss was never compiled and assets/css/style.css was never emitted - while every generated page still linked to it. That made the branch check incapable of catching a broken stylesheet. Verified by appending a deliberate syntax error to style.scss: bundle exec jekyll build --source docs -> exit 0 (passed) bundle exec jekyll build -> exit 1 (failed) It now builds from the root, so the check exercises what actually ships. This matters immediately: PR #48 consists entirely of changes to assets/css/style.scss, and its green tick from this workflow proved nothing about them. Also aligned Ruby to 3.3 to match the deploy workflow, and restricted push to main since the workflow already runs on pull_request - a same-repo PR branch was building twice per commit. Verified: both files parse, the new build command emits style.css (12286 bytes) and exits 0 on a healthy tree, and exits 1 with a broken stylesheet. Co-Authored-By: Claude Opus 5 --- .github/workflows/jekyll.yml | 5 +++++ .github/workflows/main.yml | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 47c44ff..552dae1 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -1,7 +1,12 @@ name: Deploy Jekyll site to Pages on: + # Only main. GitHub Pages accepts deployments from the configured source + # branch only, so running this anywhere else guarantees a failed `deploy` + # job and parks the run in the shared "pages" concurrency group below. + # Branch and PR builds are covered by the Test Jekyll Build workflow. push: + branches: [main] workflow_dispatch: permissions: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a36b45e..f81badf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,11 @@ name: Test Jekyll Build on: + # `pull_request` covers branches with an open PR; `push` on main covers + # everything that lands. Previously this ran on every push AND every + # pull_request, so a same-repo PR branch built twice per commit. push: + branches: [main] pull_request: jobs: @@ -14,10 +18,22 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2' + # Matches the deploy workflow, so this check runs against the same + # Ruby the published site is built with. + ruby-version: '3.3' bundler-cache: true + # Build from the repo root, exactly as the deploy workflow does. + # This previously passed `--source docs`, which is not how the site is + # assembled: _config.yml treats the repo root as the source and only + # points layouts_dir/includes_dir into docs/. Building with + # `--source docs` skipped the root-level assets/ directory entirely, so + # assets/css/style.scss was never compiled and assets/css/style.css was + # never emitted - while every generated page still linked to it. That + # made this check incapable of catching a broken stylesheet: a + # deliberate syntax error in style.scss still exited 0 here, and 1 when + # built from the root. - name: Build site - run: bundle exec jekyll build --source docs --baseurl "/gridwise" + run: bundle exec jekyll build --baseurl "/gridwise" env: JEKYLL_ENV: production