Skip to content

Commit 8d01ba3

Browse files
committed
Update README.md - change Hugo version from latest to specific version
Using latest was causing a build error because of breaking changes in the latest version of Hugo. The README file is now updated to use the same version of Hugo we are deploying to our website. Updated the GitHub action to check version of Hugo in README and deployed Hugo on push or pull. Fail operation if they have drifted apart. This will help ensure that when we roll the version of Hugo the documentation is correct.
1 parent c8d05e0 commit 8d01ba3

2 files changed

Lines changed: 65 additions & 23 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ on:
2626
branches:
2727
- main # Set a branch to deploy
2828

29+
pull_request:
30+
branches:
31+
- main
32+
2933
schedule:
3034
- cron: "0 3 * * *"
3135

@@ -75,14 +79,47 @@ jobs:
7579
content/en/history/bibliography
7680
key: bib-${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
7781

82+
# ----------------------------------------------------------------------------
83+
# Validate that README.md references the correct Hugo version.
84+
# Only runs on push/pull_request, not scheduled runs.
85+
#
86+
validate-docs:
87+
if: github.event_name == 'push' || github.event_name == 'pull_request'
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
92+
- name: Check Hugo version consistency
93+
run: |
94+
echo "Checking README.md for Hugo version $HUGO_VERSION"
95+
96+
# Check badge
97+
if ! grep -q "badge/Hugo-${HUGO_VERSION}" README.md; then
98+
echo "::error::README.md badge does not reference Hugo version $HUGO_VERSION"
99+
FAILED=1
100+
fi
101+
102+
# Check download URL
103+
if ! grep -q "hugo_extended_${HUGO_VERSION}_linux-amd64.deb" README.md; then
104+
echo "::error::README.md download URL does not reference Hugo version $HUGO_VERSION"
105+
FAILED=1
106+
fi
107+
108+
if [ "$FAILED" = "1" ]; then
109+
echo "Update README.md to use Hugo version $HUGO_VERSION"
110+
exit 1
111+
fi
112+
113+
echo "README.md Hugo version references are consistent"
114+
78115
# ----------------------------------------------------------------------------
79116
# Build the website. This job is conditional, we will always run it on a
80117
# push or if on a scheduled run the cache was determined to be out of date.
81118
#
82119
build:
83-
needs: check
120+
needs: [check, validate-docs]
121+
if: always() && (github.event_name == 'push' || github.event_name == 'pull_request' || needs.check.outputs.cacheHit != 'true') && (needs.validate-docs.result == 'success' || needs.validate-docs.result == 'skipped')
84122
runs-on: ubuntu-latest
85-
if: github.event_name == 'push' || needs.check.outputs.cacheHit != 'true'
86123
steps:
87124
- uses: actions/checkout@v4
88125
with:
@@ -140,6 +177,7 @@ jobs:
140177
path: ./public
141178

142179
deploy:
180+
if: github.event_name != 'pull_request'
143181
environment:
144182
name: github-pages
145183
url: ${{ steps.deployment.outputs.page_url }}

README.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,17 @@ Instructions for installing Hugo on various operating systems are at: [Installin
163163
For Ubuntu:
164164

165165
```bash
166-
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \
167-
| grep browser_download_url \
168-
| grep linux-amd64.deb \
169-
| grep extended \
170-
| cut -d '"' -f 4 \
171-
| wget -i -
172-
173-
sudo dpkg -i hugo_extended*linux-amd64.deb
166+
wget https://github.com/gohugoio/hugo/releases/download/v0.155.3/hugo_extended_0.155.3_linux-amd64.deb
167+
168+
sudo dpkg -i hugo_extended_0.155.3_linux-amd64.deb
174169
```
175170

176171
Verify installation:
177172

178173
```bash
179174
hugo version
180-
# Expected output (version should be v0.145.0 or later):
181-
hugo v0.155.2-d8c0dfccf72ab43db2b2bca1483a61c8660021d9+extended+withdeploy linux/amd64 BuildDate=2026-02-02T10:04:51Z VendorInfo=gohugoio
175+
hugo v0.155.3-8a858213b73907e823e2be2b5640a0ce4c04d295+extended linux/amd64 BuildDate=2026-02-08T16:40:42Z VendorInfo=gohugoio
176+
182177
```
183178

184179
### Running the Development Server
@@ -188,16 +183,16 @@ hugo v0.155.2-d8c0dfccf72ab43db2b2bca1483a61c8660021d9+extended+withdeploy linux
188183
2. Start the Hugo development server:
189184

190185
```bash
191-
hugo server --cleanDestinationDir --disableFastRender --renderToMemory
186+
hugo server --cleanDestinationDir --disableFastRender --renderToMemory
192187
```
193188

194189
Hugo will automatically download the Docsy theme and its dependencies as Hugo modules. Expected output:
195190

196191
```bash
197-
Watching for changes in /home/wstumbo/development/Interlisp.github.io/archetypes, /home/wstumbo/development/Interlisp.github.io/assets/{css,icons,js,scss}, /home/wstumbo/development/Interlisp.github.io/content/en/{history,project,software}, /home/wstumbo/development/Interlisp.github.io/layouts/{_default,_partials,_shortcodes,bibliography,redirect}, /home/wstumbo/development/Interlisp.github.io/package.json, /home/wstumbo/development/Interlisp.github.io/static/{Resources,data,docs,documentation,favicons}
198-
Watching for config changes in /home/wstumbo/development/Interlisp.github.io/config/_default, /home/wstumbo/development/Interlisp.github.io/config/development, /home/wstumbo/development/Interlisp.github.io/go.mod
192+
Watching for changes in <project-root>/archetypes, <project-root>/assets/{css,icons,js,scss}, <project-root>/content/en/{history,project,software}, <project-root>/layouts/{_default,_partials,_shortcodes,bibliography,redirect}, <project-root>/package.json, <project-root>/static/{Resources,data,docs,documentation,favicons}
193+
Watching for config changes in <project-root>/config/_default, <project-root>/config/development, <project-root>/go.mod
199194
Start building sites …
200-
hugo v0.155.2-d8c0dfccf72ab43db2b2bca1483a61c8660021d9+extended+withdeploy linux/amd64 BuildDate=2026-02-02T10:04:51Z VendorInfo=gohugoio
195+
hugo v0.155.3-8a858213b73907e823e2be2b5640a0ce4c04d295+extended linux/amd64 BuildDate=2026-02-08T16:40:42Z VendorInfo=gohugoio
201196

202197
WARN WARNING: 298 sidebar entries have been truncated. To avoid this, increase `params.ui.sidebar_menu_truncate` to at least 398 (from 100) in your config file. Section: /history/bibliography
203198

@@ -237,12 +232,13 @@ Building the website is driven by a GitHub workflow (`.github/workflows/gh-pages
237232
**Triggers:**
238233
239234
- `push` to main — updates to the Interlisp.org website
235+
- `pull_request` to main — validates changes before merge (builds but does not deploy)
240236
- Scheduled execution — ensures the bibliography remains consistent with Zotero
241237
- Manual execution — via the Actions panel in GitHub
242238
243239
**Workflow Jobs:**
244240
245-
The workflow consists of three jobs:
241+
The workflow consists of four jobs:
246242
247243
**1. `check` — Verify Bibliography is Current**
248244
@@ -254,10 +250,18 @@ https://api.zotero.org/groups/2914042/items
254250
255251
This returns metadata including the `Last-Modified-Version` header, which is incremented every time the Zotero Interlisp catalog is updated. This value is used as a cache key for the bibliography. If the cache key matches one in the current GitHub Action cache, we reuse the saved bibliography and skip rebuilding.
256252
257-
**2. `build` — Build the Website**
253+
**2. `validate-docs` — Verify Documentation Consistency**
254+
255+
Runs on `push` and `pull_request` events to ensure that README.md references the correct Hugo version. Checks that:
256+
- The Hugo badge displays the version defined in `HUGO_VERSION`
257+
- The README.md installation instructions use the correct version
258+
259+
This job prevents documentation drift from the actual build configuration.
260+
261+
**3. `build` — Build the Website**
258262
259263
- Determines if a build is needed:
260-
- On `push`: Always builds and deploys
264+
- On `push` or `pull_request`: Always builds
261265
- On schedule: Skips build if Zotero cache is current
262266
- Checks out the repository
263267
- If the Zotero cache is valid, copies its contents into the `content/en/history/bibliography` directory
@@ -267,9 +271,9 @@ This returns metadata including the `Last-Modified-Version` header, which is inc
267271
- `--cleanDestinationDir` — clears `./public` directory to avoid stale artifacts
268272
- Uses the GitHub `upload-pages-artifact` action to package and store the `./public` directory contents for deployment
269273
270-
**3. `deploy` — Deploy to GitHub Pages**
274+
**4. `deploy` — Deploy to GitHub Pages**
271275
272-
Takes the output of the build step and deploys it to GitHub Pages using the GitHub `deploy-pages` action.
276+
Takes the output of the build step and deploys it to GitHub Pages using the GitHub `deploy-pages` action. Skipped on pull requests.
273277
274278
### Environment Variables
275279
@@ -417,10 +421,10 @@ The site uses Google Custom Search to provide search results encompassing:
417421
- Interlisp GitHub repositories
418422
- Discussion groups for Medley and Interlisp
419423
420-
The search engine is configured in `config/params.yaml`:
424+
The search engine is configured in `config/_default/params.yaml`:
421425
422426
```yaml
423-
gcs_engine_id: 33ef4cbe0703b4f3ax
427+
gcs_engine_id: 33ef4cbe0703b4f3a
424428
```
425429
426430
Search results are rendered using the `search.html` layout template.

0 commit comments

Comments
 (0)