Preview Environments
Automatically deploy pull requests to isolated preview URLs for testing before merging.
How It Works
- Open a PR on a connected GitHub repo
- RailPush creates an isolated service clone with the PR branch
- A preview URL is generated (e.g.,
pr-123-myapp.apps.railpush.com) - A comment is posted on the PR with the live preview link
- When the PR is closed/merged, the preview is automatically cleaned up
API
# List preview environments
curl https://railpush.com/api/v1/preview-environments \
-H "Authorization: Bearer <token>"
# Create a preview environment
curl -X POST https://railpush.com/api/v1/preview-environments \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"service_id": "<svc-id>", "branch": "feature/new-ui", "pr_number": 42}'
# Delete a preview environment
curl -X DELETE https://railpush.com/api/v1/preview-environments/<id> \
-H "Authorization: Bearer <token>"