To launch an environment, simply add the pullpreview
label to a Pull Request:
When the deployment is successful, a direct link to the environment is displayed. Pushing new code automatically triggers a new deployment:
Merging or closing the Pull Request automatically destroys the environment and removes the pullpreview
label:
Seeing the real thing running is always better than just looking at the code.
Preview environments are a valuable tool to share progress early, get feedback, and iterate on a feature faster.
However, in most organizations, there is only a handful of staging servers available to the developers, which are hard to keep in sync, maintain, and with complicated processes to make sure you don't step on someone else's code.
PullPreview solves this with ephemeral environments for any pull request or branches, just by adding a label from the GitHub UI.
The only requirements are: a GitHub repository, an app bootable with Docker Compose, and an AWS account with a few dollars to spend every month.
Everything runs straight from GitHub to your AWS servers, no intermediary involved.
PullPreview requires one or more Docker Compose files to deploy your environment, and a GitHub Action workflow file that triggers the PullPreview action using AWS credentials to provision servers.
Below is a basic workflow file that allows SSH access for two users into the preview environments, as well as marking the master branch as always on:
# .github/workflows/pullpreview.yml
name: PullPreview
on:
push:
branches: [main]
pull_request:
types: [labeled, unlabeled, synchronize, closed, reopened]
jobs:
deploy:
if: github.event_name == 'push' || github.event.label.name == 'pullpreview' || contains(github.event.pull_request.labels.*.name, 'pullpreview')
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/[email protected]
- uses: pullpreview/[email protected]
with:
# Those GitHub users will have SSH access to the servers:
admins: crohr,qbonnard
# Alaways deploy the main branch:
always_on: main
# Specify compose file(s) to use:
compose_files: docker-compose.yml
env:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_REGION: "us-east-1"
You can be up and ready in 5 minutes!
For more details and demos, visit the Features page.