Skip to main content

Preview environments

Every pull request can get its own deployed copy of the application at a generated URL, garbage-collected automatically after a TTL.

How it works

Deploy to the preview environment instead of a fixed one:

environment: preview
  • Hostname — when the platform sets a preview domain, the app is served at <app>-<tenant>.<preview-domain> with no ingress configuration needed. An explicit ingress.host still wins.
  • TTL — the Application carries an expiry (default 72h, platform configurable). Every new upload extends it, so active PRs stay alive and abandoned ones disappear.
  • Cleanup — on expiry the operator deletes the Application, which cascades to its Releases, workloads, and build jobs.

Per-PR pipeline

name: preview
on:
pull_request:

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: company/pagifier-deploy@v1
id: deploy
with:
config: frontend/pagifier.yaml
environment: preview
token: ${{ secrets.PAGIFIER_TOKEN }}

- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `🔍 Preview deployed: ${{ steps.deploy.outputs.url }}`,
})

Platform configuration

The platform team enables hostname generation and tunes the TTL in the Helm chart:

preview:
domain: preview.company.com # wildcard DNS + TLS for *.preview.company.com
ttl: 72h