Engineering
Aug 21, 2025
Building like we do: Preview Deployments for Every PR
Building like we do: Preview Deployments for Every PR

Josh John
Engineering
At Aptible, we’ve always believed in making infrastructure easier for developers. That includes making sure new code changes can be tested safely, confidently, and in isolation - before they hit production.
One of the ways we’ve achieved that internally is through preview deployments: short-lived apps and databases that spin up automatically when a pull request is opened and tear down automatically when the PR is closed. This gives us a production-like preview with minimal effort, enabling our engineers to quickly develop and test changes.
Today, we’re excited to share a template so you can do the same in your own projects:
👉 Preview Deployment Example on GitHub
This template is powered by GitHub Actions and the Aptible CLI. It automates the entire preview lifecycle, from provisioning to teardown, all tied to your PRs.
What the Template Does
Here’s what the Preview Deployment Template includes:
GitHub Action: Automates the deployment of a new preview app and database every time a PR is opened.
Aptible CLI Integration: Uses the CLI under the hood to provision apps and deploy code
Automatic Teardown: The preview app and database are destroyed when your PR is closed or merged.
Secure by Default: Previews run on Aptible’s secure platform, with encryption, isolated containers, and compliance-grade defaults.
It’s everything you need to set up ephemeral environments; no custom scripting required.
Why Preview Deployments Matter
Preview environments are convenient and unlock better collaboration and safer shipping:
Review UI or behavior changes without guessing
Let teammates, QA, or stakeholders test without deploying to staging
Validate infrastructure and integration changes before merging
Automatically cleaned up to avoid infrastructure waste
Get Started
Check out our detailed guide for getting started with preview deployments.
The general steps are:
Add the workflows from our example repository to your own repository
→ https://github.com/aptible/deploy-demo-preview-example/tree/main/.github/workflows
Configure your app and secrets
Open a PR
→ Preview apps and databases are deployed
Test your changes
Close your PR
→ Preview apps and databases are deprovisioned
If you need help getting it working for your app or want to talk through more advanced setups (like databases, multiple services, or team-wide sandboxes), contact Aptible Support.
Build Like We Do
This template brings a bit of our internal toolkit to every Aptible developer. Preview deployments have made our engineering team more confident and efficient, and now, they can do the same for you.
At Aptible, we’ve always believed in making infrastructure easier for developers. That includes making sure new code changes can be tested safely, confidently, and in isolation - before they hit production.
One of the ways we’ve achieved that internally is through preview deployments: short-lived apps and databases that spin up automatically when a pull request is opened and tear down automatically when the PR is closed. This gives us a production-like preview with minimal effort, enabling our engineers to quickly develop and test changes.
Today, we’re excited to share a template so you can do the same in your own projects:
👉 Preview Deployment Example on GitHub
This template is powered by GitHub Actions and the Aptible CLI. It automates the entire preview lifecycle, from provisioning to teardown, all tied to your PRs.
What the Template Does
Here’s what the Preview Deployment Template includes:
GitHub Action: Automates the deployment of a new preview app and database every time a PR is opened.
Aptible CLI Integration: Uses the CLI under the hood to provision apps and deploy code
Automatic Teardown: The preview app and database are destroyed when your PR is closed or merged.
Secure by Default: Previews run on Aptible’s secure platform, with encryption, isolated containers, and compliance-grade defaults.
It’s everything you need to set up ephemeral environments; no custom scripting required.
Why Preview Deployments Matter
Preview environments are convenient and unlock better collaboration and safer shipping:
Review UI or behavior changes without guessing
Let teammates, QA, or stakeholders test without deploying to staging
Validate infrastructure and integration changes before merging
Automatically cleaned up to avoid infrastructure waste
Get Started
Check out our detailed guide for getting started with preview deployments.
The general steps are:
Add the workflows from our example repository to your own repository
→ https://github.com/aptible/deploy-demo-preview-example/tree/main/.github/workflows
Configure your app and secrets
Open a PR
→ Preview apps and databases are deployed
Test your changes
Close your PR
→ Preview apps and databases are deprovisioned
If you need help getting it working for your app or want to talk through more advanced setups (like databases, multiple services, or team-wide sandboxes), contact Aptible Support.
Build Like We Do
This template brings a bit of our internal toolkit to every Aptible developer. Preview deployments have made our engineering team more confident and efficient, and now, they can do the same for you.
At Aptible, we’ve always believed in making infrastructure easier for developers. That includes making sure new code changes can be tested safely, confidently, and in isolation - before they hit production.
One of the ways we’ve achieved that internally is through preview deployments: short-lived apps and databases that spin up automatically when a pull request is opened and tear down automatically when the PR is closed. This gives us a production-like preview with minimal effort, enabling our engineers to quickly develop and test changes.
Today, we’re excited to share a template so you can do the same in your own projects:
👉 Preview Deployment Example on GitHub
This template is powered by GitHub Actions and the Aptible CLI. It automates the entire preview lifecycle, from provisioning to teardown, all tied to your PRs.
What the Template Does
Here’s what the Preview Deployment Template includes:
GitHub Action: Automates the deployment of a new preview app and database every time a PR is opened.
Aptible CLI Integration: Uses the CLI under the hood to provision apps and deploy code
Automatic Teardown: The preview app and database are destroyed when your PR is closed or merged.
Secure by Default: Previews run on Aptible’s secure platform, with encryption, isolated containers, and compliance-grade defaults.
It’s everything you need to set up ephemeral environments; no custom scripting required.
Why Preview Deployments Matter
Preview environments are convenient and unlock better collaboration and safer shipping:
Review UI or behavior changes without guessing
Let teammates, QA, or stakeholders test without deploying to staging
Validate infrastructure and integration changes before merging
Automatically cleaned up to avoid infrastructure waste
Get Started
Check out our detailed guide for getting started with preview deployments.
The general steps are:
Add the workflows from our example repository to your own repository
→ https://github.com/aptible/deploy-demo-preview-example/tree/main/.github/workflows
Configure your app and secrets
Open a PR
→ Preview apps and databases are deployed
Test your changes
Close your PR
→ Preview apps and databases are deprovisioned
If you need help getting it working for your app or want to talk through more advanced setups (like databases, multiple services, or team-wide sandboxes), contact Aptible Support.
Build Like We Do
This template brings a bit of our internal toolkit to every Aptible developer. Preview deployments have made our engineering team more confident and efficient, and now, they can do the same for you.
At Aptible, we’ve always believed in making infrastructure easier for developers. That includes making sure new code changes can be tested safely, confidently, and in isolation - before they hit production.
One of the ways we’ve achieved that internally is through preview deployments: short-lived apps and databases that spin up automatically when a pull request is opened and tear down automatically when the PR is closed. This gives us a production-like preview with minimal effort, enabling our engineers to quickly develop and test changes.
Today, we’re excited to share a template so you can do the same in your own projects:
👉 Preview Deployment Example on GitHub
This template is powered by GitHub Actions and the Aptible CLI. It automates the entire preview lifecycle, from provisioning to teardown, all tied to your PRs.
What the Template Does
Here’s what the Preview Deployment Template includes:
GitHub Action: Automates the deployment of a new preview app and database every time a PR is opened.
Aptible CLI Integration: Uses the CLI under the hood to provision apps and deploy code
Automatic Teardown: The preview app and database are destroyed when your PR is closed or merged.
Secure by Default: Previews run on Aptible’s secure platform, with encryption, isolated containers, and compliance-grade defaults.
It’s everything you need to set up ephemeral environments; no custom scripting required.
Why Preview Deployments Matter
Preview environments are convenient and unlock better collaboration and safer shipping:
Review UI or behavior changes without guessing
Let teammates, QA, or stakeholders test without deploying to staging
Validate infrastructure and integration changes before merging
Automatically cleaned up to avoid infrastructure waste
Get Started
Check out our detailed guide for getting started with preview deployments.
The general steps are:
Add the workflows from our example repository to your own repository
→ https://github.com/aptible/deploy-demo-preview-example/tree/main/.github/workflows
Configure your app and secrets
Open a PR
→ Preview apps and databases are deployed
Test your changes
Close your PR
→ Preview apps and databases are deprovisioned
If you need help getting it working for your app or want to talk through more advanced setups (like databases, multiple services, or team-wide sandboxes), contact Aptible Support.
Build Like We Do
This template brings a bit of our internal toolkit to every Aptible developer. Preview deployments have made our engineering team more confident and efficient, and now, they can do the same for you.
Latest From Our Blog

Company
We've upgraded the Standard Support Plan

Gabriella Valdes
Customer Success

Company
We've upgraded the Standard Support Plan

Gabriella Valdes
Customer Success

Company
We've upgraded the Standard Support Plan

Gabriella Valdes
Customer Success

Company
We've upgraded the Standard Support Plan

Gabriella Valdes
Customer Success

Thoughts & Ideas
HIPAA on PaaS: Vercel, Render, Heroku, Railway, and Aptible

Gabriella Valdes
Customer Success

Thoughts & Ideas
HIPAA on PaaS: Vercel, Render, Heroku, Railway, and Aptible

Gabriella Valdes
Customer Success

Thoughts & Ideas
HIPAA on PaaS: Vercel, Render, Heroku, Railway, and Aptible

Gabriella Valdes
Customer Success

Thoughts & Ideas
HIPAA on PaaS: Vercel, Render, Heroku, Railway, and Aptible

Gabriella Valdes
Customer Success

Company
Aptible in 2024: Year in Review

Frank Macreery
CEO

Company
Aptible in 2024: Year in Review

Frank Macreery
CEO

Company
Aptible in 2024: Year in Review

Frank Macreery
CEO

Company
Aptible in 2024: Year in Review

Frank Macreery
CEO




548 Market St #75826 San Francisco, CA 94104
© 2025. All rights reserved. Privacy Policy
548 Market St #75826 San Francisco, CA 94104
© 2025. All rights reserved. Privacy Policy
548 Market St #75826 San Francisco, CA 94104
© 2025. All rights reserved. Privacy Policy
548 Market St #75826 San Francisco, CA 94104
© 2025. All rights reserved. Privacy Policy