Habib Ali Machpud
← Writing

Engineering opinion

A simple delivery pipeline for one VPS

Why this private repository uses a read-only poller and a local deployment policy.

The first Ask Habib deployment established a public page, a health API, and a recoverable container configuration. Updating it still required an administrator to pull images and run the deployment commands. The next step was to automate that path while keeping its authority small and visible.

The resulting pipeline validates a release in GitHub Actions, publishes the tested images privately, and lets the VPS discover and deploy the successful release. A separate workflow verifies the public application afterward.

Why the VPS pulls

The project uses a private repository on GitHub Free. The desired protected deployment-environment features were unavailable for that combination. The chosen design keeps deployment SSH keys out of Actions.

A timer on the VPS reads GitHub using a repository-specific token with read access to contents and workflow artifacts. The existing private image-pull credential is separate. Neither credential is available to application containers. No interactive CI account or new webhook receiver is required.

The timer checks roughly once a minute after its preceding run finishes. This adds a small delay compared with an immediate push connection, but keeps discovery outbound and leaves a small operational path to inspect.

A successful workflow is only the beginning

The poller accepts a completed successful run of one configured release workflow for the current main revision. It rejects pull-request and fork runs, other branches, and validation runs that did not publish a release.

The manifest arrives as a bounded archive. Its digest, contents, repository, platform, revision, and image references are checked before it reaches the gateway. The gateway then pulls and inspects the actual images. Manifest data is not a host script and cannot supply a replacement runtime policy.

Artifact downloads have their own credential detail: the GitHub API returns a signed object-storage URL. The poller follows it with a new request that does not carry the GitHub bearer token. Tests cover that boundary explicitly. GitHub documents this redirect.

Separate versions from host policy

The host retains a reviewed, root-owned Compose policy. Releases can select only API and web image digests from the approved package namespace. They cannot change host mounts, networks, connector versions, secret paths, or arbitrary environment settings.

Host locks serialize changes. The gateway records current, previous, and pending release state using atomic writes and recovers an interrupted transaction before another operation begins.

This remains privileged code with Docker access. Filesystem restrictions limit accidental writes; the reviewed gateway, fixed policy, and root-only files remain the command boundary. Updating an application image does not automatically replace those host scripts.

Prove the version serving requests

The API exposes its compiled source revision in a health-response header. A deployment checks running image references, process restrictions, private network addresses, and the expected public revision. A public request ID must also appear in the current API’s log.

A read-only workflow waits for the public revision and checks the page and assets from outside the VPS. It starts after publication finishes: making publication wait for deployment would create a dependency cycle with a poller that accepts only completed successful releases.

The first automated application change connected the existing health-check button to its status region for assistive technology. That small change traversed the real main-branch checks, private publication, host poller, and public verification.

Exercise rollback

The acceptance drill restored the previous pinned image pair and checked its API and page from outside the VPS. A subsequent ordinary poll left that rollback in place. Explicit retry then reapplied the same published artifacts and restored the intended release without rebuilding it.

Caching the processed attempt matters. Retrying a failed release every minute could repeatedly disrupt the application, and immediately replaying a deliberately rolled-back release would defeat the operator’s action. A new successful publication or an explicit administrator retry resumes deployment.

Rollback is bounded to the recorded application snapshots. It does not reverse a future database migration or provide host-level disaster recovery. Persistent data will need separate compatibility and restore rules.

Isolate a failed verification layer

During installation, the gateway’s initial public check received an HTTP error while external checks and the existing application were healthy. Separating the runtime-policy check from the HTTP probe isolated the default client identity as the failing part. An explicitly named verifier User-Agent passed from the same host.

The timer stayed disabled while this was diagnosed. The fix passed CI with request-header regression tests before installation resumed. The activation gate kept that verification problem from becoming an application interruption.

What comes next

The project has a path from main to a verified private release and a tested path back to its previous application version. Deployments remain single-instance updates and can briefly interrupt traffic. Credentials need controlled renewal, and host-policy changes still need explicit review.

The next stage is to build the portfolio’s content and pages, with later features using this same delivery path.

Related decision: use Docker Compose.