Page
lighthouse Deployment Design
This document describes the implementation-facing design of the Lighthouse deployment pipeline.
Table of Contents
- Goals
- Pipeline Stages
- Runtime Layout
- Source Discovery
- Materialization Model
- Deployment Model
- State and Retention
Goals
The pipeline is designed to:
- run unattended from cron under the
lighthouseuser - remain directly callable by hand through the same CLI
- treat Git repositories as the source of truth for content
- emit deterministic Jekyll-ready Markdown with explicit permalinks
- deploy through atomic release-directory symlink swaps
Pipeline Stages
The core apply path is:
- load and validate YAML configuration
- acquire the runtime lock
- clone or update the site repository and source repositories
- discover Markdown sources while honoring
.lighthouseignore - validate URL mapping and local references
- materialize
_automated_posts/and copied assets - run the configured Jekyll build command
- copy the built site into
releases/<timestamp>/ - atomically repoint
activeandcurrent - write a full state snapshot
- clean old releases and matching state files
Runtime Layout
The runtime tree under ~/.lighthouse/ is split into:
config/for human-maintained YAMLcache/repos/for checked-out repositoriesstates/for deployment snapshotslogs/for verbose run logslockfor overlap prevention
This keeps build state and logs out of the site repository itself.
Source Discovery
Each configured source repository:
- is cloned from
CLONE_URL - is updated from the configured
BRANCH - is scanned recursively from repo root for
*.md - honors
.lighthouseignorewith.gitignore-style inheritance
URL generation rules:
- lowercase all source paths
- remove the
.mdsuffix - preserve the remaining relative path
- apply the repo-level
URL_PATH - map repo-root
README.mdto the repo root URL
Materialization Model
For every discovered Markdown file, the pipeline:
- resolves the canonical title from front matter, heading, or filename
- reads
last_modified_atfrom Git - assigns a stable
publish_datefrom the first deployment state that saw the file - rewrites local Markdown references to generated site permalinks
- copies referenced local non-Markdown assets into
assets/generated/ - writes a Jekyll source file into
_automated_posts/
The generated source includes explicit front matter for permalink, author, source metadata, publish date, and last-modified time.
Deployment Model
Deployment root:
/var/www/lighthouse/
releases/
<timestamp>/
active -> releases/<timestamp>
current -> releases/<timestamp>
The freshly built site is copied into a new release directory. After
basic release validation, active and current are atomically
repointed to that release.
State and Retention
Every successful apply writes a full state snapshot:
~/.lighthouse/states/state-<timestamp>.json
That snapshot carries forward first-seen publication dates so older state files can be retired without losing publication history for live posts.
Retention cleanup runs only after a successful deploy. Old releases and their matching state snapshots are deleted together. Logs are retained indefinitely.