← zabolotny.de
DEENRUUA

Home / Notes

DevOps · CI/CD · Next.js

CI/CD for Next.js 15 on a VPS: GitHub Actions, PM2 reload and Caddy

Manual deployments were slow and error-prone. Today a git push is enough – no downtime and no PaaS.

Serge Zabolotny ·

Starting point

PflegeOasis runs on my own VPS (Next.js 15, PostgreSQL 16, Drizzle ORM). At first I logged in via SSH and ran the steps by hand. That costs time, and every forgotten step is a possible source of errors.

The flow

  1. A push to the main branch triggers a GitHub Actions workflow.
  2. The workflow connects to the server via SSH.
  3. On the server git pull, pnpm install and pnpm build run.
  4. pm2 reload restarts the Next.js app – without downtime.
  5. Caddy sits in front as a reverse proxy and takes care of TLS certificates automatically.

Schematically (simplified), the server does the following during a deployment:

git pull
pnpm install
pnpm build
pm2 reload <app-name>

Why no PaaS?

Limits: the build runs on the server itself. With little RAM a build can strain the running app – then it makes more sense to build on the CI runner and upload only the finished result.

Result

Deployment via git push: faster, repeatable and without manual work. The workflow is the documentation.

Keep reading

AI · LLM · Content pipeline

AI content with human-in-the-loop: 200+ guide articles from LLM drafts

With care law, AI mistakes are not acceptable. This is how I use a language model as a writing aid without handing it the responsibility.

DevOps · Cloudflare · Zero Trust

Zero Trust for the homelab: Cloudflare Tunnel and Access instead of open dashboards

An internal dashboard was publicly reachable via a subdomain. Here is how I locked it down with Cloudflare Tunnel, Cloudflare Access and Tailscale.

Case study · Health · Guides

PflegeOasis: care-level calculator, objection-letter generator and AI content with human review

A free portal that helps relatives find their way through the German care system – with calculators, checklists and more than 200 guide articles.

Career · DevOps · Field report

Career change into DevOps in Germany: my plan, my evidence, my gaps

I am looking for a permanent IT job, with DevOps and platform engineering as the best fit. This is an open account of what the market offers according to the numbers, where I come from and how I make my skills verifiable.

Comments

Join the discussion: comments run on GitHub Discussions (sign in with a GitHub account). Content from GitHub/giscus is only loaded after you click. Privacy

More from practice

Find more notes, case studies and projects on the homepage.

All notes Case study MeisterMeld Case study PflegeOasis Case study Kernbohr-Expert Back to the homepage