Skip to content

feat: add PR preview environment workflow#136

Closed
solarhell wants to merge 1 commit intomainfrom
feat/pr-preview-env
Closed

feat: add PR preview environment workflow#136
solarhell wants to merge 1 commit intomainfrom
feat/pr-preview-env

Conversation

@solarhell
Copy link
Copy Markdown
Collaborator

Summary

  • Add GitHub Actions workflow for automatic PR preview deployments
  • Each PR gets an isolated Dory instance at pr-<number>.preview.getdory.dev
  • Uses Traefik + Docker on a self-hosted VPS with auto SSL via Let's Encrypt

How It Works

  1. PR opened/updated → build Docker image → push to DockerHub → deploy to VPS
  2. Traefik auto-discovers containers via Docker labels → provisions SSL certificate
  3. PR closed → container and image automatically cleaned up

PR Comment Lifecycle

A single bot comment tracks the deployment status through its lifecycle:

Status When
🔨 Building Image build started
✅ Ready Deployment successful, preview URL is live
⏳ Queued Preview slots full (max 3 concurrent)
❌ Failed Deployment failed (with link to workflow logs)
🗑️ Destroyed PR closed, environment cleaned up

Required Secrets

Secret Description
PREVIEW_SERVER_HOST VPS IP address
PREVIEW_SERVER_USER SSH user (root)
PREVIEW_SERVER_SSH_KEY SSH private key
PREVIEW_AUTH_SECRET Better Auth secret for preview instances

DOCKERHUB_USERNAME and DOCKERHUB_TOKEN should already be configured.

Infrastructure

Server provisioning is managed in dorylab/infra (Ansible + Traefik).

Closes #134

Automatically deploy preview environments for each PR using
Traefik + Docker on a self-hosted VPS.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dory Ready Ready Preview, Comment Apr 1, 2026 7:36am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
dory-admin Ignored Ignored Apr 1, 2026 7:36am
dory-beta Ignored Ignored Apr 1, 2026 7:36am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Preview Environment for this PR

Name Status Preview Updated (UTC)
pr-136 ❌ Failed (cb4a8a5) 2026-04-01 07:29:51

Deployment failed. Check the workflow logs for details.

@solarhell solarhell marked this pull request as draft April 1, 2026 07:40
@solarhell solarhell closed this Apr 1, 2026
@solarhell solarhell deleted the feat/pr-preview-env branch April 1, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-PR Preview Environments with Self-Hosted VPS + Cloudflare Tunnel

1 participant