CI/CD

GitHub Actions pipeline for the frontend

CI/CD Pipeline

The frontend includes a GitHub Actions pipeline that runs on every push to main and on pull requests.

Pipeline Overview

Push / PR
    │
    ▼
┌─────────┐     ┌────────────┐     ┌──────────┐
│  Test    │ ──▶ │ Build Prod │ ──▶ │  Deploy  │
└─────────┘     └────────────┘     └──────────┘

Stage 1: Test

  1. Builds the dev Docker image
  2. Runs npm audit (moderate severity level)
  3. Runs vitest tests

Triggered on both pull requests and pushes to main.

Stage 2: Build Production Image

Runs only after tests pass and only on pushes to main:

  1. Builds the production Docker image (multi-stage)
  2. Pushes to GitHub Container Registry (ghcr.io/{owner}/{repo}:main)
  3. Uses GitHub Actions cache for Docker layers

Stage 3: Deploy

Runs only after the build succeeds:

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

Required GitHub Secrets

SecretDescription
DOKPLOY_WEBHOOK_URLDokploy deployment webhook URL

Docker Multi-Stage Build

The Dockerfile uses a multi-stage build:

Dev Stage

  • Node 20 Alpine base
  • Installs all dependencies (including devDependencies)
  • Used for testing and development

Production Stage

  • Node 20 Alpine base
  • Installs only production dependencies
  • Builds the Nuxt application
  • Runs the server from .output/server/index.mjs
  • Minimal image size for deployment