Add build-and-push and deploy jobs to CI workflow #142
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The CI pipeline currently only runs tests. There is no step that builds production Docker images or deploys them to the VPS. Without this, every deployment is a manual process — someone has to SSH into the VPS, pull the repo, build images, and restart services by hand.
This issue adds two new CI jobs:
build-and-push— builds production Docker images and pushes them to the Gitea container registrydeploy— SSHes into the VPS over Tailscale and restarts services with the new imagesBoth jobs only run on semver tags (deployment trigger defined in #143). This issue covers the job definitions themselves.
Prerequisites: #141 (Tailscale setup), production Dockerfiles (#134, #135).
What to do
1. Enable the Gitea container registry
In
infra/gitea/app.ini(or however the Gitea instance is configured), ensure packages are enabled:Images will be served at
192.168.178.71:3005/marcel/familienarchiv/backendand.../frontend.2. Create an SSH deploy key pair
On the home server (not the VPS):
gitea_deploy_key.pubcontents to/home/deploy/.ssh/authorized_keyson the VPSgitea_deploy_key(private key) as a Gitea secret namedVPS_SSH_PRIVATE_KEY3. Add a Gitea secret for the registry password
The VPS needs to pull images from the Gitea registry. Create a Gitea access token (user settings → Applications → Access tokens) with
read:packagescope, and store it as:REGISTRY_TOKEN— used by the VPS to authenticatedocker pull4. Add jobs to
.gitea/workflows/ci.ymlAppend after the existing
e2e-testsjob:5. First-time VPS setup (one-off, before first deploy)
Clone the repo onto the VPS and create the
.envfile:The compose files and
Caddyfileneed to be present — the deploy job only restarts containers, it does not update compose files. Compose file changes require a manual pull or a separate sync step (out of scope for this issue).Gitea secrets summary
VPS_TAILSCALE_IPVPS_SSH_PRIVATE_KEYREGISTRY_TOKENdocker pullon VPSE2E_ADMIN_PASSWORDAcceptance criteria
v*tag triggersbuild-and-push→deployin CI.build-and-pushfrom running (needs:dependency).