CI/CD

GitHub Actions pipeline for testing, building, and deploying

CI/CD Pipeline

The backend includes a GitHub Actions pipeline that runs on every push to main.

Pipeline Overview

Push to main
    │
    ▼
┌─────────┐     ┌────────────┐     ┌──────────┐
│  Test    │ ──▶ │ Build Prod │ ──▶ │  Deploy  │
└─────────┘     └────────────┘     └──────────┘

Stage 1: Test

Builds the dev Docker image and runs the full quality suite:

  1. Validate and check composer.json / composer.lock
  2. Security audit for known vulnerabilities
  3. Install dependencies
  4. Set up test database (PostgreSQL + migrations)
  5. Generate JWT keys
  6. Run unit tests
  7. Run functional tests
  8. PHPStan static analysis
  9. PHP CS Fixer check (dry-run)

Stage 2: Build Production Image

Runs only if all tests pass. Builds the frankenphp_prod Docker target and pushes to GitHub Container Registry (ghcr.io).

Stage 3: Deploy

Sends a POST request to the Dokploy webhook URL. Dokploy pulls the new image and restarts the application.

Required GitHub Secrets

SecretDescription
DOKPLOY_WEBHOOK_URLDokploy deployment webhook URL

GITHUB_TOKEN is automatically provided by GitHub Actions for pushing to GHCR.

Running Checks Locally

Before pushing, run the same checks the CI runs:

make test       # Tests
make phpstan    # Static analysis
make csfix      # Code style (auto-fix)

If make csfix changes any files, commit them before pushing — the CI runs CS Fixer in dry-run mode.