Repository navigation
ci(deploy): build once on GitHub, secret-scan, push to GHCR; server pulls by SHA - #742
Merged
Merged
Conversation
…y SHA
- images.yml (replaces ci-cache-warm.yml): build compose images, secret-scan
every layer (canary .env, keys, token shapes) before push, tag :<full sha>
- deploy.yml: images job next to ci; server pulls that SHA, falls back to
--build; rollback pulls/publishes the rollback SHA; old tags cleaned up
- .dockerignore: nested .env*, appsettings.*.json, keys, service accounts,
bin/obj (audit found all of these reach images from a dirty checkout)
- admin/ssg-worker: drop pnpm store from the install layer
- docker-compose.yml: image: ${IMAGE_REGISTRY:-textstack}-<svc>:${IMAGE_TAG:-latest}
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TBqXDqcbLYbPwGKnTsWYLz
…line Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TBqXDqcbLYbPwGKnTsWYLz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner-approved "build once, deploy many".
Secrets (the gate): audit with a canary
.env+ planted files (dirty-checkout simulation), scanning env, history and every layer of all 6 images. A clean CI checkout leaked nothing; a dirty checkout leaked untrackedapps/admin/.env*,packages/shared/.env.local,appsettings.Production.jsonand a PEM into 5 images — root.dockerignoreexcluded only the root.env. Fixed (.env*at any depth except.env.example,appsettings.*.json, keys, service-account json, bin/obj); pnpm store removed from admin/ssg images.scripts/scan-image-secrets.shgates the push (positive control verified). Only build arg anywhere:GIT_SHA.Flow:
images.yml(replacesci-cache-warm.yml): build with gha cache → scan → pushghcr.io/mrviduus/textstack-<svc>:<full sha>withGITHUB_TOKEN.deploy.yml:imagesjob alongsideci; deploy checks out this run's SHA (ff-only), logs in withGITHUB_TOKENinto a tempDOCKER_CONFIG, pulls each image (900 s),up -d --no-build; any failed pull falls back toup -d --build. Retags:latest; removes old GHCR tags. Rollback pulls by SHA.docker-compose.yml:image: ${IMAGE_REGISTRY:-textstack}-<svc>:${IMAGE_TAG:-latest}— unset = old names; local dev unchanged. Merged with fix(privacy): policy, delete page and Play Data Safety match the code; no query strings in logs; container log rotation #738's logging anchors.Cost: $0 — public repo Actions minutes free; GHCR free for public packages;
GITHUB_TOKENpulls free. First push creates private packages; owner flips to public after a clean scan.Code review: one finding (deploy pulled main's tip, not its own SHA) fixed. actionlint clean;
docker compose configOK.🤖 Generated with Claude Code
https://claude.ai/code/session_01TBqXDqcbLYbPwGKnTsWYLz