---
title: "Neon Twin: How to deploy a change tested in Neon to prod in RDS"
description: "Schema changes tested on Neon database branches can be promoted to an AWS RDS production Postgres database through GitHub Actions that run when a pull request merges."
url: "https://swe.quest/articles/neon-twin-how-to-deploy-a-change-tested-in-neon-to-prod-in-rds-09282f8f58bccb12"
canonical: "https://neon.com/blog/neon-twin-deploy-workflow"
source: "Neon"
published: "2024-08-15"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["schema-migrations","postgres","ci-cd","deployment"]
---

# Neon Twin: How to deploy a change tested in Neon to prod in RDS

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-08-15, 10 min read, How-to. Original: [https://neon.com/blog/neon-twin-deploy-workflow](https://neon.com/blog/neon-twin-deploy-workflow)

## Summary

Schema changes tested on Neon database branches can be promoted to an AWS RDS production Postgres database through GitHub Actions that run when a pull request merges. Neon's schema diff shows how a dev branch differs from main. From there, migrations are applied in one of two ways: hand-written dated .sql files that a workflow detects via git diff and runs with psql, or Prisma migrations applied with \`prisma migrate deploy\`. A follow-up pg\_dump/pg\_restore job then re-syncs the Neon Twin from production.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- GitHub Actions workflows ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))
- Database schema migrations ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

Neon, AWS RDS, GitHub Actions, Prisma, psql, pg\_dump, Neon Twin

## Related posts

- [Neon Twin: Move Dev/Test/Staging to Neon, Keep Production on RDS](https://swe.quest/articles/neon-twin-move-dev-test-staging-to-neon-keep-production-on-rds-a26cd19df36ac332.md): Neon · 2024-07-24 · Medium · 7 min read · PostgreSQL, CI/CD, Databases
  A Neon Twin is a nightly-synced copy of an RDS Postgres production database kept in Neon for dev, test and staging, so teams get instant provisioning, branching and scale-to-zero without migrating production.
- [A database for every preview environment using Neon, GitHub Actions, and Vercel](https://swe.quest/articles/a-database-for-every-preview-environment-using-neon-github-actions-and-vercel-dd5fe24cba2d12b5.md): Neon · 2023-04-14 · Medium · 14 min read · PostgreSQL, CI/CD, Deployment, Schema migrations
  Neon's copy-on-write branching can give every pull request its own production-like Postgres database, avoiding the bottlenecks of shared staging or shared preview databases.
- [Neon Twin: Automate Partial Data Dumps with Postgres and GitHub Actions](https://swe.quest/articles/neon-twin-automate-partial-data-dumps-with-postgres-and-github-actions-0e318b92e17657ec.md): Neon · 2025-02-10 · Medium · 7 min read · PostgreSQL, CI/CD, Testing
  A scheduled GitHub Actions workflow can keep a Neon "Twin" refreshed with a partial copy of a production Postgres database.
- [Adopting Neon branching in CI/CD pipelines: a practical story by Shepherd](https://swe.quest/articles/adopting-neon-branching-in-ci-cd-pipelines-a-practical-story-by-shepherd-7c4ee09d2fb5431a.md): Neon · 2024-07-11 · Medium · 5 min read · CI/CD, PostgreSQL, Schema migrations, Testing, Serverless
  Shepherd, an insurtech startup that moved its Alchemist pricing engine from SQLite to Postgres, uses Neon's copy-on-write database branches to give every pull request an ephemeral test database.
- [Track Schema Changes Automatically in Your Pull Requests](https://swe.quest/articles/track-schema-changes-automatically-in-your-pull-requests-a44727ec3dcc4112.md): Neon · 2024-11-28 · Medium · 5 min read · Schema migrations, CI/CD, PostgreSQL
  Neon's Schema Diff GitHub Action compares the schema of a pull request's Neon child branch against its parent (or a specified base\_branch) and posts the result as an SQL patch in a single PR comment.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
