Skip to content

chore: restructure to per-stack monorepo layout#147

Open
vpatrin wants to merge 2 commits into
mainfrom
chore/monorepo-restructure
Open

chore: restructure to per-stack monorepo layout#147
vpatrin wants to merge 2 commits into
mainfrom
chore/monorepo-restructure

Conversation

@vpatrin

@vpatrin vpatrin commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restructure services/stacks/ with one docker-compose.yml per stack (postgres, caddy, coupette-redis, umami, uptime-kuma, observability)
  • Rewrite scripts/deploy_infra.sh to iterate stacks in dependency order and discover *.env.enc dynamically under stacks/
  • Update .sops.yaml regex, .github/dependabot.yml directories, and CI compose validation to match the new layout
  • Add ref input to .github/workflows/deploy.yml + make deploy REF=... so any branch matching main|chore/*|feat/*|fix/*|docs/* can be deployed end-to-end before merging
  • Update slash command paths (.claude/commands/*.md) and README tree to match the new layout

Changes

  • stacks/ — per-stack composes; service definitions, networks, volumes, container names unchanged from previous root compose
  • scripts/deploy_infra.sh — loops over stacks, dynamic SOPS discovery, per-stack validate → pull → up, Caddy validate + reload, systemd unit sync, 7 retried healthchecks
  • Makefile — targets refactored to iterate $(STACKS); deploy now accepts REF=...
  • .github/workflows/deploy.yml — new ref input, git fetch && git checkout && git pull --ff-only on the VPS
  • .sops.yamlservices/.+/\.env(\.enc)?$stacks/.+/\.env(\.enc)?$
  • .github/workflows/ci.yml — compose job now validates each stack including dev/prod overrides
  • .github/dependabot.yml — directories list updated to per-stack paths

Deploy notes

  • Production environment branch protection updated via gh api to allow main, chore/*, feat/*, fix/*, docs/* patterns (was main only)
  • After squash-merge, redeploy with make deploy (defaults to main) — the VPS is currently checked out on this branch from pre-merge testing

Test plan

  • All 6 stack composes validate locally including prod overrides
  • Caddyfile validates against caddy:2.11.2
  • make deploy REF=chore/monorepo-restructure — full prod deploy from branch, all healthchecks green
  • No stale services/ references in any executable surface (composes, scripts, systemd, CI, Makefile, slash commands)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant