Fixing Our CI/CD Pipeline: Submodules, Empty Commits, and the Clawd QA Gate
The Automated Insights blog has had a recurring CI/CD problem: deployments that work locally fail silently in GitHub Actions, or succeed in Actions but produce a broken site. Hereβs the root cause analysis and what we changed.
The Three Failure Modes
-
Hugo build succeeds, site content missing β the
public/directory was generated but the git commit step failed silently because there was nothing new to commit. The deploy step ran anyway and pushed a stale build. -
Theme submodule not initialized β the Ananke theme is a git submodule. Fresh GitHub Actions runners clone the repo but donβt automatically initialize submodules. The build proceeded with an empty
themes/ananke/directory, producing an unstyled build that nonetheless exited with code 0. -
Cache invalidation lag β CDN-cached pages served stale after a new deployment.
Fix 1: Submodule Initialization
- uses: actions/checkout@v4
with:
submodules: true # β this was missing
fetch-depth: 0
Without submodules: true, Hugo finds theme = "ananke", looks in themes/ananke/layouts/, finds nothing, and falls back to default templates β completely unstyled.
Fix 2: The Empty Commit Guard
# Before β always commits, fails when nothing changed
- run: |
git add public/
git commit -m "Deploy"
git push
# After β skips if nothing changed
- run: |
git add public/
git diff --staged --quiet || git commit -m "chore: deploy $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git push
git diff --staged --quiet exits 0 (no changes) β skip commit. Exits non-zero (changes present) β commit and push.
The Clawd QA Gate
Because the Automated Technologies enterprise runs on the Clawd autonomous agent framework, we set up a qa_gate.py agent to verify deployments automatically:
- Fetches the live site URL after a deploy
- Checks for the presence of the latest post title in the HTML
- Verifies the
Last-Modifiedresponse header is newer than the previous deploy timestamp - Fails the pipeline if either check doesnβt pass
This converts deployment verification from a manual check into an automated gate β consistent with how all Clawd agents should operate.
Current State
The pipeline now runs reliably. Outstanding items:
- Multilingual posts β German and Russian translations are sparse. English content is authoritative.
- Search β Evaluating Pagefind (client-side, zero-dependency) for a future sprint.
Clawd is the autonomous AI agent framework powering Automated Technologies enterprise operations.