CI/CD

CI couldn't SSH into my server, so the server pulled

My task manager deployed on every push to main, and GitHub Actions never touched the server. SSH on that box listened only to the LAN and my WireGuard VPN, and the deploy had to keep it that way. So CI published an image, and the server went and got it.

On 2026-05-18 the server built the image itself until CI took over that afternoon.

The pipeline

git push main → Actions builds the image → ghcr.io/ibrah5em/stm → Watchtower polls every 60 s → container recreated

The workflow builds the multi-stage Dockerfile with Buildx and the GitHub Actions cache, and pushes two tags: :latest, which Watchtower follows, and :sha-<short>, which never moves. There’s no deploy step in it at all.

On the server, the deploy folder holds two files: the compose file and .env. No source code. The container opts in to Watchtower with a label, com.centurylinklabs.watchtower.enable=true, so Watchtower leaves the other containers on the box alone.

A push was live in about three minutes of CI plus up to 60 seconds of polling. Rollback is one line: point image: at a :sha- tag and docker compose up -d.

Two snags

  • The server ran an early Docker 29 release, which refused API versions below 1.44. Watchtower’s bundled client asked for 1.25 and got rejected. Pinning DOCKER_API_VERSION=1.44 on the Watchtower container fixed it.
  • Docker on that box ran with iptables: false, and the NAT rules lived in UFW’s before.rules for one network, docker_management. On the default bridge Watchtower’s digest check to ghcr.io failed and logged a warning every cycle, though the pull itself still worked. It went on the same network as the apps.

One smoke-test push that day changed only a comment, to force a new image digest and watch the container roll.

The cost

Watchtower deploys whatever :latest is, and the workflow runs no tests. A broken main would have gone live in about four minutes, with nothing in between to stop it.

The home lab shut down in August 2026 and the app was retired with it. The laptop that ran it is a NAS now.