"Deployment Basics (7/7) — Building an Automatic Deployment Pipeline: PR, Test, Preview, Production"

The core value of automatic deployment is not that humans click fewer buttons. It is that humans get fewer chances to skip the important steps.


Key Takeaways

  • The smallest useful release pipeline is branch -> pull request -> CI -> preview -> merge -> production.
  • Separating preview from production prevents review links from becoming live-user links.
  • GitHub Actions can own validation, while Vercel or Railway can own actual deployment.
  • Even solo developers benefit because automation reduces error and preserves rollback clarity.

1. Why this comes last

Many beginners want CI/CD first. That is the wrong order. Without understanding Git, GitHub, and the deployment target, workflow YAML becomes cargo-cult automation.

An automatic deployment pipeline is not one tool. It is the coordination of the layers you learned earlier in the series.

2. The minimum safe pipeline

The model to remember is simple:

feature branch work
  -> pull request
  -> GitHub Actions test/build
  -> preview deployment
  -> merge to main
  -> production deployment

The key design idea is separation: validation and public release should not be the same step.

3. What each stage is for

Branch

The isolated lane for new work.

Pull Request

The reviewable unit. Even when working alone, writing a PR description forces clarity.

CI

The automated check that build, tests, or linting still pass.

Preview

The real clickable environment for review. UI and routing issues often show up here before they show up in code review.

Production

The environment real users depend on.

4. Where GitHub Actions fits best

A strong beginner default is to use GitHub Actions as the validation layer.

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm test
      - run: npm run build

Even when Actions does not perform the final deployment, it still creates a release gate.

5. Connecting the deployment target

The deployment target then handles runtime release.

With Vercel

  • branch push -> preview deployment
  • merge to main -> production deployment

With Railway

  • tracked branch push -> deploy
  • optionally wait for GitHub Actions through Wait for CI

This creates a clean division: GitHub Actions verifies, the hosting platform runs.

6. Why solo builders still need this

Solo developers often think CI/CD is only for teams. In practice, solo work benefits even more because there are fewer external checks.

An automatic pipeline preserves:

  • which change reached production
  • which validation passed before release
  • what to roll back to if something breaks

That is not bureaucracy. It is memory and safety.

7. Five operating rules worth keeping

  1. do not work directly on main
  2. do not ship to production without a PR step
  3. do not merge without at least build or test verification
  4. separate preview and production secrets
  5. keep the release history readable enough to roll back quickly

That is already a solid release discipline for small personal projects.

References

  • GitHub Docs, Understanding GitHub Actions — https://docs.github.com/en/actions/get-started/understand-github-actions
  • GitHub Docs, Deploying with GitHub Actions — https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/control-deployments
  • Vercel Docs, Deploying Git Repositories with Vercel — https://vercel.com/docs/git
  • Railway Docs, Controlling GitHub Autodeploys — https://docs.railway.com/deployments/github-autodeploys

This is Part 7 of the Deployment Basics series. Series complete. Re-reading Part 1 after Part 7 usually makes the whole flow snap into place.

๋Œ“๊ธ€

์ด ๋ธ”๋กœ๊ทธ์˜ ์ธ๊ธฐ ๊ฒŒ์‹œ๋ฌผ

Agent Memory Engine (2/10) — Building an AI Agent Memory System with SQLite Alone

"ML Foundations (9/9) — PyTorch vs TensorFlow, and the Road to Local LLMs"

"RAG Core Study (14/26) — Evaluation Sets with RAGAS & DeepEval"

"ML Foundations (8/9) — Deep Learning Architectures: CNN, RNN, Attention"

"ML Foundations (7/9) — Deep Learning Training: Optimizers, Regularization, Initialization"

OpenClaw to Hermes Migration (2/13) — What to Preserve, Partially Port, or Discard

AI Agents I Built (5/7) — Building an Automated Blogger API Publishing System