Skip to main content

🔄 CI/CD


Workflow Overview

The CI/CD workflow are divided into two major workflows:

  1. Backend CI/CD Pipeline
  2. Frontend CI/CD Pipeline

The main workflow is defined in the cicd.yml file and leverages reusable workflows:

  • pipeline-ci-backend.yml
  • pipeline-ci-frontend.yml

Each workflow is triggered on changes to specific paths and includes feature flags to enable or disable specific jobs.


Backend CI/CD Pipeline

Trigger Conditions

  • Triggered on push and pull_request events to the main branch.
  • Monitors changes in the following paths:
    • server/**
    • docker-compose.yml
    • .github/workflows/*-backend.yml

Feature Flags (Inputs)

InputDescriptionDefault Value
BACKEND_COMPILE_ENABLEDEnable compile jobtrue
BACKEND_CHECKSTYLE_ENABLEDEnable checkstyle jobtrue
BACKEND_UNIT_TESTS_ENABLEDEnable unit tests jobtrue
BACKEND_BUILD_ENABLEDEnable build jobtrue

Jobs

  1. Compile (compiles gradle application)
  2. Checkstyle (runs checkstyle analysis)
  3. Unit tests (runs unit tests)
  4. Build (build Spring Boot application)

Frontend CI/CD Pipeline

Trigger Conditions

  • Triggered on push and pull_request events to the main branch.
  • Monitors changes in the following paths:
    • client/**
    • docker-compose.yml
    • .github/workflows/*-frontend.yml

Feature Flags (Inputs)

InputDescriptionDefault Value
FRONTEND_INSTALL_ENABLEDEnable install jobtrue
FRONTEND_LINT_ENABLEDEnable lint jobfalse
FRONTEND_BUILD_ENABLEDEnable build jobtrue

Jobs

  1. Install (installs dependencies and sets up Angular CLI)
  2. Lint (runs lint check)
  3. Build (builds Angular application)

Additional Jobs

Changes Detection

Identifies whether changes occurred in backend or frontend paths.

Docker Compose

Builds and starts services using Docker Compose if changes are detected in either frontend or backend.

InputDescriptionDefault Value
DOCKER_COMPOSE_ENABLEDEnable Docker Compose jobtrue
DEPLOY_ENABLEDEnable Coolify deployment jobfalse

Deployment

Triggers deployment to Coolify (two SECRET variables are needed: COOLIFY_WEBHOOK and COOLIFY_TOKEN).


Secrets

The workflows rely on the following secrets:

  • COOLIFY_WEBHOOK: URL for triggering deployment.
  • COOLIFY_TOKEN: Authorization token for Coolify.