Back to journal
Engineering

"We Shipped One-Command Edge Deploys — Here's How Your Team Can Too"

excerpt: "Most deploy pipelines in Accra still look like a Slack DM that says 'please SSH into the server.' We fixed that. One function call, one region flag, zero prayer."

PMML Engineering 24 April 2026 5 min read 7 views
"We Shipped One-Command Edge Deploys — Here's How Your Team Can Too"

Most deploy pipelines in Accra still look like a Slack DM that says "please SSH into the server." A developer pushes to main, pings someone on WhatsApp, and waits. Sometimes the someone is on a call. Sometimes the server is in Frankfurt. Sometimes the prayer doesn't land.

We got tired of the prayer.

Last month our infrastructure team at Prime Mesh Matrix shipped a single TypeScript function that replaced our entire deployment ritual. One call. One region flag. Zero SSH. And because we build for teams that operate across Accra, Tamale, and Kumasi — where latency isn't theoretical, it's commercial — we made region-awareness a first-class citizen.

Here's the function:

export async function deploy(app: App) {
  await app.edge.roll({ region: "eu-west" });
}

That's it. That's the deploy.


What this actually does

Global cloud infrastructure network

Behind those two lines sits a pipeline that took us three sprints to get right. When app.edge.roll() fires, it triggers a chain that handles the messy parts your team shouldn't think about at 11pm on a Friday:

Container builds — The function detects your runtime (Node, Deno, Bun) and builds an OCI-compliant container image. No Dockerfile required. If you have one, it respects it. If you don't, it infers from your package.json and lockfile.

Region routing — The region flag isn't decorative. It determines which edge nodes receive traffic first. For most Ghana-stack teams, eu-west (Ireland/London) gives the best latency trade-off — close enough to West Africa for sub-200ms round trips, mature enough infrastructure for 99.95% uptime. We also support af-south (Cape Town) for southern-corridor traffic.

Rolling zero-downtime swap — Traffic shifts gradually. Old containers drain. New ones warm up. If the health check fails, the roll stops. No one gets paged for a bad build.

Environment hydration — Secrets from your vault get injected at boot, not baked into the image. Your .env.production stays out of version control where it belongs.


Why this matters for Ghana-stack teams

Engineering team collaborating on deployment strategy

Let's be honest about the problem. If you build software in Ghana, you face constraints that the average Silicon Valley deployment tutorial doesn't acknowledge:

Bandwidth is expensive. A 2GB Docker image push over a Telecel or MTN connection can take 40 minutes — or timeout entirely. Our pipeline compresses layers aggressively, deduplicates unchanged layers, and pushes deltas only. Average push size dropped from 1.8GB to 140MB.

Servers aren't always local. Most Ghanaian teams deploy to European or South African data centres. That's fine — but it means your deploy pipeline needs to handle cross-continent latency gracefully. Retry logic, chunked uploads, and resumable transfers aren't optional. They're survival.

The "DevOps person" is usually the founder. In a 4-person team, nobody has time to maintain Terraform configs, Kubernetes manifests, and CI/CD YAML files. The deploy function abstracts all of that into a single call your most junior developer can run.

If your deploy process requires tribal knowledge, it's not a process — it's a liability.

Try it today

You can integrate this pattern into any Next.js or Node project. Here's a more complete example with error handling and notifications:

import { deploy, type App } from "@primemesh/edge";
import { notify } from "@primemesh/alerts";

interface DeployConfig {
  app: App;
  region: "eu-west" | "af-south" | "us-east";
  channel?: string;
}

export async function shipIt({ app, region, channel }: DeployConfig) {
  try {
    const result = await deploy(app, {
      region,
      healthCheck: "/api/health",
      drainTimeout: 30_000,
      rollbackOnFail: true,
    });

    await notify({
      channel: channel ?? "#deploys",
      message: `✅ ${app.name} deployed to ${region} in ${result.duration}ms`,
    });

    return result;
  } catch (error) {
    await notify({
      channel: "#incidents",
      message: `🔴 Deploy failed for ${app.name}: ${error.message}`,
      urgent: true,
    });

    throw error;
  }
}

Call it from your CI, from a script, or from a button in your admin panel. The function doesn't care where it runs. It only cares that the app gets to the edge.


What we learned building this

Three lessons from three sprints that might save you time:

Health checks should be deep, not just "200 OK." Our /api/health endpoint checks database connectivity, cache warmth, and queue availability. A container that boots but can't reach Postgres isn't healthy — it's a liar.

Rollbacks should be automatic, not discussed in a war room. We set rollbackOnFail: true by default. If the new version fails health checks within 60 seconds, traffic reverts to the previous version. No human decision required.

Logging the deploy duration changed our culture. When every deploy posts its duration to Slack, it creates gentle peer pressure to keep builds fast. Our average deploy went from 4 minutes to 47 seconds in two months — not because we mandated it, but because nobody wanted to be the team with the slow build.


What's next

We're working on two things for Q3:

First, multi-region deploys — a single call that rolls to eu-west and af-south simultaneously, with automatic traffic steering based on the request's origin IP. A user in Kumasi hits Cape Town. A user in London hits Ireland. Same codebase, zero config.

Second, preview deploys from pull requests — every PR gets a live URL with a 48-hour TTL. Designers review on real devices. QA tests against real APIs. No more "it works on my machine" conversations.


Start the conversation

If your team is still deploying with SSH and hope, we should talk. We've open-sourced the core of this pipeline and we're running a free workshop on May 15th in Accra for teams that want to set it up.

Book a 20-minute call →

Or browse the source: github.com/primemeshmatrix/edge-deploy

If you've built something similar for your team, we'd love to hear about it. Drop us a message — the best ideas in this space are coming from teams who actually ship in the markets they serve.


Prime Mesh Matrix is a software engineering studio in Accra, Ghana. We build bespoke mobile, web, USSD, and cloud applications for organisations across West Africa. Our clients include Ghanaweb, Ghana Hotel Association, and Askof Productions.

Keep reading

You might also like