CI/CD & Infrastructure as Code

How Vivolar automates testing, building, and deployment through GitHub Actions, Railway, and IaC configuration files.

ci-cd deployment railway github-actions

Philosophy: Code Over Configuration

Everything that can be expressed as code lives in the repository. Only secrets and environment-specific URLs go in the deployment dashboard. This principle is captured in the project rule: always prefer code over manual configuration.

CI Pipeline

GitHub Actions runs on every push and pull request:

Backend CI:

Frontend CI:

Both pipelines must pass before merging. No green CI, no merge.

Deployment

Vivolar deploys to Railway with a two-environment strategy:

Staging (stg branch):

Production (main branch):

Infrastructure as Code

Configuration lives in the repository:

backend/railway.toml    — healthcheck, build settings
backend/nixpacks.toml   — JDK version, build command
frontend/railway.toml   — healthcheck, static serving
frontend/nixpacks.toml  — Node version, build command

These files are the source of truth. If Railway needs a configuration change, the .toml file is updated, committed, and deployed — not clicked in a dashboard.

Pre-Deployment Validation

Before any deployment, a 10-point checklist runs automatically:

  1. Tests green
  2. CORS configuration matches frontend URL
  3. OAuth2 redirect URIs are correct
  4. Frontend API URL matches backend domain
  5. No hardcoded localhost references
  6. Node version consistency
  7. Java version consistency
  8. Required environment variables present
  9. Forward headers strategy configured
  10. Health check endpoints configured

Blockers must be fixed. Warnings are reviewed. This script (scripts/pre-deploy-validate.sh) prevents the most common deployment failures.

Lessons