- AWS Lightsail
- Ephemeral instances
- Any app
- Just need a container
- 10min
- install time
Full-fidelity preview environments for GitHub
🚀 Git push, deployed
Once installed in your repository, this action is triggered any time a change
is made to Pull Requests labelled with the pullpreview
label, or one of the
always-on branches.
When triggered, it will:
- Check out the repository code.
- Provision a cheap AWS Lightsail instance, with docker and docker-compose set up.
- Continuously deploy the specified pull requests and branches, using your docker-compose file(s).
- Report the preview instance URL in the GitHub UI.
It is designed to be the no-nonsense, cheap, and secure alternative to services that require access to your code and force your app to fit within their specific deployment system and/or require a specific config file.
Testimonials
It saved us thousands in development costs, and the monthly cost of the Lightsail instances is immaterial compared to SaaS tools that want to license on a per user or per repository basis.
An incredibly valuable tool for enhancing my workflow and improving collaboration with my team. One of the standout features of this action is its ease of setup.
We were stuck trying out lots of different managed solutions with Vercel, Render etc, but they all had problems. Using docker-compose with self-hosting made it so much simpler 👍
We were struggling with product reviews, as we performed them too late on the developpement cycle and faced difficulties to isolate the issues. It lead to long threads, frictions and was energy and time consuming for both technical and product teams. Then came PullPreview: an easy way to review PRs for product teams and ease communication between developers and PM/Designers.
Features
-
Works with your existing tooling: If your app can be started with docker-compose, it can be deployed to preview environments with PullPreview.
-
Can be started and destroyed easily: You can manage preview environments by adding or removing the
pullpreview
label on your Pull Requests. You can set specific branches as always on, for instance to continuously deploy your master branch. -
Cheap too run: Preview environments are launched on AWS Lightsail instances, which are both very cheap (10USD per month, proratized to the duration of the PR), and all costs included (bandwith, storage, etc.)
-
Takes the privacy of your code seriously: The workflow happens all within a GitHub Action, which means your code never leaves GitHub or your Lightsail instances.
-
Makes the preview URL easy to find for your reviewers: Deployment statuses and URLs are visible in the PR checks section, and on the Deployments tab in the GitHub UI.
-
Persists state across deploys: Any state stored in docker volumes (e.g. database data) will be persisted across deploys, making the life of reviewers easier.
-
Easy to troubleshoot: You can give specific GitHub users the authorization to SSH into the preview instance (with sudo privileges) to further troubleshoot any issue. The SSH keys that they use to push to GitHub will automatically be installed on the preview servers.
-
Fully integrated into the GitHub UI: Logs for each deployment run are available within the Actions section, and direct links to the preview environments are available in the Checks section of a PR, and in the Deployments tab of the repository.
Useful for the entire team
- Product Owners: Interact with a new feature as it’s built, give valuable feedback earlier, reduce wasted development time.
- Developers: Show your work in progress, find bugs early, deliver the right feature.
- Ops: Concentrate on high value tasks, not maintaining staging environments.
- CTOs: Don’t let your code run on third-party servers: your code always stays private on either GitHub’s or your servers.
Installation & Usage
- Getting Started
- Action Inputs / Outputs
- Handling Seed Data
- Workflow Examples
- FAQ
→ Please see the wiki for the full documentation.
Example
Workflow file with the master
branch always on:
Is this free?
The code for this Action is completely open, but licensed under the Prosperity Public License (see LICENSE). In practice this means that:
-
If you are a non-profit individual, then it is free to run.
-
In all other cases, you must buy a commercial license. This costs 300€/year, and includes any number of repositories and users, within a single GitHub organization. You can try for 30 days before buying the license.
Then, for each preview environment, you will pay the per-hour cost of your instances. For example, a 1GB RAM micro instance will cost you 0.007$/hour, 0.168$/day, and 5$/month (AWS lightsail pricing).
That means you pay the retail price for the resources you use, without any additional markup, whether you have 2 or 20 temporary environments.
Example: if your team opens 50 pull requests with PullPreview enabled per month, and on average they stay open for 3 days, using a 4GB RAM instance this would cost you: 50720.028 = 100$ for AWS lightsail, plus 25€ for the licence, i.e. ~125$/month all included.
You won’t find a better solution around
- Tech that everyone understands: no Kubernetes. One environment = one server.
- Fully integrated into GitHub: no separate UI necessary.
- No SaaS or third-party involved: Your code stays private, and the servers are hosted in your own AWS account.
- Debugging is easy: you have root SSH access to the environment VM for any troubleshooting.
- Advanced security: set custom firewall rules for your preview environment VMs, ensuring your data stays protected.
- Custom domains: use your own domain or subdomain for your preview environments.
- Support for SSL/TLS: automatically provision Let’s Encrypt certificates.
Who did this?
👋 I’m Cyril Rohr, a freelance CTO/DevOps from France. Over the years I’ve built and maintained many homemade solutions for this problem. PullPreview is the condensed version of everything I’ve learned. I hope you’ll find it useful.
You might also be interested in my other projects:
- RunsOn: 10x cheaper GitHub Actions runners, fully self-hosted on AWS.
- Packager.io: DEB/RPM packaging made simple.