Skip to content

Ephemeral Environments

Medium — good to knowCI/CD & DevOps

ELI5 - The Vibe Check

An ephemeral environment is a full, working copy of your app spun up automatically for a single pull request, and torn down the moment that PR closes. Instead of everyone fighting over one shared staging server that's perpetually broken by someone else's half-finished feature, every PR gets its own clean sandbox that lives and dies with it.

Real Talk

Ephemeral environments are short-lived, isolated deployments created automatically for a specific branch, pull request, or test run, and destroyed once no longer needed. They give reviewers and automated tests a real, fully deployed environment to work against without the contention and drift of a single shared staging environment.

Show Me The Code

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run deploy:preview -- --pr=${{ github.event.number }}
      # torn down automatically when the PR closes

When You'll Hear This

"Every PR gets an ephemeral environment now, reviewers can click through the actual feature before approving." / "The ephemeral environment for that branch already got torn down, spin up a new one."

Made with passive-aggressive love by manoga.digital. Powered by Claude.