Reuse published photo variants and deploy the validated build
All checks were successful
Check & deploy / validate (push) Successful in 1m45s
Check & deploy / deploy (push) Has been skipped

This commit is contained in:
Andras Schmelczer 2026-11-10 20:55:14 +00:00
commit 8dbea46ddb

View file

@ -37,7 +37,7 @@ Run the full local validation suite with:
npm run lint:check
```
This generates assets (validating the photo catalog against `src/pictures/` in the process), checks source photos for EXIF/XMP/IPTC metadata, type-checks, lints TypeScript and SCSS, and checks formatting.
This checks formatting, type-checks, lints TypeScript and SCSS, checks source photos for EXIF/XMP/IPTC metadata, and validates the photo catalog against `src/pictures/`. Image encoding runs separately as part of the build.
Run unit tests separately:
@ -61,6 +61,8 @@ Photo order, captions, and alt text live in `src/photo-catalog.json`. Add new so
The generated files under `src/generated/` and `public/static/photos/` are intentionally ignored because they are reproducible from the source images and catalog.
CI sets `PHOTO_ASSET_CACHE_URL=https://photos.schmelczer.dev/static/photos/` to reuse published image variants. Filenames include a hash of the source photo and encoding settings, so changed photos or settings produce new files. Downloads are checked for image format and dimensions and saved atomically. Missing variants are encoded locally with the same quality settings. Builds without this variable work offline; a clean build encoding every photo can take around 25 minutes on the two-core runner. The generator reports progress for each photo.
## Gallery Navigation
Photo selections use `#photo=<id>` links, where the ID comes from the source filename rather than its position or generated asset hash. Selecting a thumbnail or using the arrow, Home, or End keys updates the URL; thumbnails can also be copied or opened in another tab. Reloading or opening a photo link selects that photo with the slideshow paused. Back and Forward restore selections, and automatic slideshow advances replace the current URL without adding history entries. Missing or unknown IDs fall back to the first photo.
@ -85,4 +87,4 @@ Review image changes after stripping because this rewrites the JPEG files.
## Deployment
The Forgejo workflow validates pull requests and trusted pushes with `npm ci`, `npm run lint:check`, `npm test`, `npm run build`, and a Playwright smoke test. Only pushes to `main` deploy, by copying `dist/` to `/pages/photos/`.
The Forgejo workflow validates pull requests and trusted pushes with `npm ci`, `npm run lint:check`, `npm test`, `npm run build`, and a Playwright smoke test. CI previews the existing build for the smoke test instead of rebuilding. Trusted human pushes to `main` hand that validated `dist/` artifact to the deploy job and the Pages copier, which publishes it to `/pages/photos/` without another build.