-
Notifications
You must be signed in to change notification settings - Fork 16
Getting Started
PullPreview deploys any app that can be started by Docker Compose.
By default it looks for docker-compose.yml in your repository root.
If your compose file is elsewhere, set app_path and/or compose_files in workflow inputs.
Create a repository label named pullpreview (or use another label and set label input).
By default, PullPreview provisions Lightsail instances in your AWS account.
You can also use Hetzner by setting provider: hetzner.
Add repository secrets:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY- optional
AWS_REGION(defaults tous-east-1)
For least privilege setup, see Recommended AWS Configuration.
Add repository secret:
HCLOUD_TOKENHETZNER_CA_KEY
HETZNER_CA_KEY is a private SSH key used by PullPreview as an SSH CA for per-run cert authentication.
Generate one once and store it as a secret:
ssh-keygen -t rsa -b 3072 -m PEM -N "" -f hetzner_ca_keyKeep only the private key in the secret (do not upload the .pub file).
And set action inputs:
provider: hetzner- optional
region(defaults tonbg1) - optional
image(defaults toubuntu-24.04) - optional
instance_type(defaults tocpx21)
Create .github/workflows/pullpreview.yml:
name: PullPreview
on:
schedule:
- cron: "30 */4 * * *"
push:
branches: [master]
pull_request:
types: [labeled, unlabeled, synchronize, closed, reopened, opened]
concurrency: ${{ github.ref }}
permissions:
contents: read
pull-requests: write
jobs:
deploy:
if: github.event_name == 'push' || (github.event.action != 'closed' && github.event.action != 'unlabeled' && (github.event.label.name == 'pullpreview' || contains(github.event.pull_request.labels.*.name, 'pullpreview')))
runs-on: ubuntu-slim
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- uses: pullpreview/action@v6
with:
admins: "@collaborators/push"
always_on: master
app_path: .
# optional: switch provider
# provider: hetzner
# region: nbg1
# image: ubuntu-24.04
# instance_type: cpx21
# optional: automatic HTTPS termination with Let's Encrypt
# proxy_tls: web:80
env:
# Lightsail credentials (default provider)
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
# Hetzner credential (only when provider: hetzner)
# HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
# HETZNER_CA_KEY: ${{ secrets.HETZNER_CA_KEY }}Open a PR, add the pullpreview label, and watch the workflow run.
You will get:
- workflow checks
- PR comment updates (building/ready/error/destroyed)
- GitHub job summary with preview + logs links
- SSH connection details in logs and summary when deploy succeeds
For more patterns, see Workflow Examples and Lifecycle.