close
The Wayback Machine - https://web.archive.org/web/20201016221334/https://github.com/pullpreview/action
Skip to content
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
img
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

PullPreview

A GitHub Action that starts live environments for your pull requests and branches.

Spin environments in one click

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:

  1. Check out the repository code
  2. Provision a cheap AWS Lightsail instance, with docker and docker-compose set up
  3. Continuously deploy the specified pull requests and branches, using your docker-compose file(s)
  4. 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.

Image

Image

Image

Image

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.

Features

Preview environments that:

  • work 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.

  • are 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.)

  • take 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.

  • make 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.

  • persist state across deploys: Any state stored in docker volumes (e.g. database data) will be persisted across deploys, making the life of reviewers easier.

  • are 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.

  • are 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.

Image

Image

Installation & Usage

→ Please see the wiki for the full documentation.

Example

Workflow file with the master branch always on:

# .github/workflows/pullpreview.yml
name: PullPreview
on:
  push:
  pull_request:
    types: [labeled, unlabeled, closed]

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
    - uses: actions/checkout@v2
    - uses: pullpreview/action@v3
      with:
        # Those GitHub users will have SSH access to the servers
        admins: crohr,other-github-user
        # A staging environment will always exist for the master branch
        always_on: master
        # Use the cidrs option to restrict access to the live environments to specific IP ranges
        cidrs: "0.0.0.0/0"
        # PullPreview will use those 2 files when running docker-compose up
        compose_files: docker-compose.yml,docker-compose.staging.yml
        # The preview URL will target this port
        default_port: 80
        # Use a 512MB RAM instance type instead of the default 2GB
        instance_type: nano_2_0
        # Ports to open on the server
        ports: 80,5432
      env:
        AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
        AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
        AWS_REGION: "us-east-1"

Is this free?

The code for this Action is completely open source, and licensed under the Prosperity Public License (see LICENSE).

If you are a non-profit individual, then it is free to run (in that case, please tell me so and/or pass the word around!).

In all other cases, you must buy a license. More details on pullpreview.com.

Thanks for reading until the end!

You can’t perform that action at this time.