Second Thursdays, 6:00⁠–⁠7:30 pm Lawrence, KS

Test page

How to test pages

Pull-based deploys from GitHub Releases

A small, dependable pattern for deploying a web app to a single server (or a few) without giving CI any access to the server. The server pulls releases itself, migrates the database, switches atomically, checks health and rolls back on failure.

Overview

developer ──publishes──▶ GitHub Release (tag)
                              │  CI builds and attaches app-<tag>.tar.gz + .sha256
                              ▼
server: systemd timer (every minute) ──▶ deploy script "check"
   ├─ guards: newer than live? approved author? assets uploaded? checksum OK?
   ├─ unpack to  /srv/<app>/releases/<tag>/
   ├─ run DB migrations from the new release (dedicated migrate user)
   ├─ atomic switch: /srv/<app>/current → releases/<tag>, reload PHP-FPM / app server
   ├─ health check over localhost
   └─ on failure: point current back at the previous release, email an alert

Nothing pushes to the server. CI only needs to publish files to GitHub. The server needs one read-only GitHub token.