Skip to content

Commit 21f69a6

Browse files
committed
Build the site in Actions instead of legacy Pages
wip: pushing to resolve the lockfile on CI Ruby
1 parent 1d9a1a1 commit 21f69a6

4 files changed

Lines changed: 101 additions & 2 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: TEMP generate Gemfile.lock
2+
3+
# Throwaway helper: resolves the Gemfile on the same Ruby the Pages workflow uses
4+
# and uploads the resulting lockfile as an artifact, so it can be committed.
5+
# Deleted before this branch is merged.
6+
7+
on:
8+
workflow_dispatch:
9+
10+
jobs:
11+
lock:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: "3.3"
18+
- run: bundle lock
19+
- run: |
20+
echo "----- resolved versions -----"
21+
grep -E "^\s{4}(jekyll|kramdown|jekyll-seo-tag|jekyll-feed|jekyll-sitemap|minima|sass-embedded) " Gemfile.lock || true
22+
- uses: actions/upload-artifact@v4
23+
with:
24+
name: gemfile-lock
25+
path: Gemfile.lock

.github/workflows/convert-svg-images.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,10 @@ jobs:
7272
for f in ${{ steps.convert.outputs.converted_files }}; do
7373
git add "$f"
7474
done
75-
git commit -m "chore: add PNG thumbnails converted from SVG post images [skip ci]"
75+
# No [skip ci] here: this push has to reach the Pages deploy workflow,
76+
# or a bot-generated thumbnail would sit undeployed until the next
77+
# human push. Re-triggering this workflow is harmless and terminates
78+
# immediately — the rerun finds the PNG already exists, converts 0,
79+
# and the `if: converted != '0'` guard below skips the commit.
80+
git commit -m "chore: add PNG thumbnails converted from SVG post images"
7681
git push

.github/workflows/pages.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build and deploy site
2+
3+
# Replaces the built-in "legacy" GitHub Pages build (Pages source: branch), which
4+
# builds server-side with the github-pages gem and is pinned to Jekyll 3.x —
5+
# ignoring this repo's Gemfile (jekyll ~> 4.3). Building here means local and
6+
# production use the same toolchain, and the build log is ours to read.
7+
#
8+
# Requires the repo's Pages source to be set to "GitHub Actions"
9+
# (Settings → Pages → Build and deployment → Source). Until that switch is made,
10+
# the `build` job still runs and validates, and `deploy` is the only part that
11+
# needs the new setting.
12+
13+
on:
14+
push:
15+
branches: [master]
16+
pull_request:
17+
workflow_dispatch:
18+
19+
# Queue deployments rather than collapsing them. `cancel-in-progress: false`
20+
# matters here: the legacy builder silently folded one commit's deploy into an
21+
# in-flight build for an earlier commit, reported success, and left the site a
22+
# commit behind for four weeks. Queuing makes each commit get its own publish.
23+
concurrency:
24+
group: pages
25+
cancel-in-progress: false
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: "3.3"
38+
bundler-cache: true
39+
40+
- name: Build with Jekyll
41+
env:
42+
# Legacy Pages built with JEKYLL_ENV=production; keep that identical so
43+
# the switch doesn't quietly change rendered output.
44+
JEKYLL_ENV: production
45+
run: bundle exec jekyll build --trace
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
# Defaults to ./_site
50+
51+
deploy:
52+
needs: build
53+
# Only master publishes. Pull requests build and link-check but never deploy.
54+
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
55+
runs-on: ubuntu-latest
56+
permissions:
57+
pages: write
58+
id-token: write
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ _site
55
.jekyll-cache
66
.jekyll-metadata
77

8-
Gemfile.lock
8+
# Gemfile.lock is intentionally committed: the site is built by
9+
# .github/workflows/pages.yml rather than by GitHub's legacy Pages builder, so
10+
# the lockfile is what keeps production builds reproducible and stops an
11+
# unrelated gem release from breaking a deploy. Jekyll won't publish it —
12+
# _config.yml already lists it under `exclude`.
913
.bundle/
1014
vendor/

0 commit comments

Comments
 (0)