Skip to content

CI/CD Pipeline Design

Overview

GitLab CI/CD pipeline for partizap-frontend with semantic-release auto-versioning. All validation and release jobs run inside Docker containers (node:22-alpine) on a shell executor.

Pipeline Architecture

develop push:
  lint ─────────┐
  typecheck ────┼─→ docker build dev → deploy staging (auto)
  test ─────────┘
     (docker run node:22-alpine, parallel)

main push:
  semantic-release (docker run node:22-alpine + git) → tag v*

tag v*:
  docker build prod (versioned + latest) → deploy prod (manual button)

Three Pipelines

TriggerStagesDeploy
push to developvalidate (parallel) → build → deploydev.partizap.ru (auto)
push to mainreleasecreates tag v*
tag v*build → deploypartizap.ru (manual)

Design Decisions

Validation only on develop

Code is verified on develop. By the time it's merged to main, it's already passed lint/typecheck/test. No need to re-run on main.

Each validate job is self-contained

Each job runs docker run node:22-alpine sh -c "npm ci && npm run <command>". No shared state, no install stage, no artifacts, no cache. Simple and debuggable.

Trade-off: npm ci runs 3 times (~11 sec each). But jobs are parallel, so wall time is +11 sec, not +33 sec.

npm ci always runs inside node:22-alpine

Eliminates lockfile version mismatch between local dev (npm 11 / Node 24) and CI. The lockfile is always consumed by the same npm version that exists in node:22-alpine.

semantic-release in Docker

Runs in node:22-alpine with apk add git. Requires GITLAB_TOKEN passed as env var. Uses --ignore-scripts (nuxt prepare not needed for release).

@nuxt/eslint always enabled

Remove NODE_ENV !== 'production' condition from nuxt.config.ts. Nuxt tree-shakes the eslint module at build time — it doesn't affect production bundle.

Prod deploy is manual

Tag pipeline builds the Docker image, but deploy requires manual click in GitLab UI. Prevents accidental production deploys.

Docker images tagged with version

partizap-frontend-prod:v1.2.3 + partizap-frontend-prod:latest. Enables rollback to specific version.

Conventional Commits → Versioning

PrefixVersion bumpExample
feat:minor (1.0→1.1)feat: catalog filters
fix:patch (1.0.0→1.0.1)fix: broken pagination
perf:patchperf: cache categories
BREAKING CHANGE:major (1→2)in commit body
chore: / docs: / ci:no releasechore: update deps

GitLab Requirements

CI/CD Variables

VariableDescription
GITLAB_TOKENProject Access Token (api + write_repository), Masked + Protected

Protected Tags

Pattern v* — only maintainers or CI can create version tags.

Files

FilePurpose
.gitlab-ci.ymlPipeline definition
.releaserc.jsonsemantic-release config
DockerfileMulti-stage build (deps → build → runtime)
docker-compose.dev.ymlStaging container (port 3000)
docker-compose.prod.ymlProduction container (port 3001)

Changes Required

  1. .gitlab-ci.yml — rewrite: remove install stage, validate via docker run, release via docker run
  2. nuxt.config.ts — remove NODE_ENV !== 'production' condition for @nuxt/eslint
  3. CLAUDE.md — update CI/CD section