CI/CD Workflow Documentation
Workflow Structure
The CI/CD pipeline consists of three jobs:
1. build-cache
- Purpose: Build and cache Docker build dependencies
- Runs on:
ubuntu-latest-ca - Container: None (runs directly on runner)
- Outputs:
deps_hashandcache_hit
2. ci-pipeline
- Purpose: Run tests, build binaries, and update documentation
- Runs on:
ubuntu-latest-ca - Container: Uses cached build image from
build-cachejob - Services: PostgreSQL for BDD tests
- Steps:
- Checkout code
- Set database environment variables
- Generate Swagger documentation
- Build all packages
- Run BDD tests with coverage
- Run unit tests with coverage
- Run code formatting
- Build binaries
- Update badges and version
3. docker-push
- Purpose: Build and push Docker images to registry
- Runs on:
ubuntu-latest-ca - Container: None (runs directly on runner)
- Trigger: Only on
mainbranch orfeature/move-docker-jobbranch - Steps:
- Checkout code
- Login to Gitea Container Registry
- Build production Docker image
- Push image with version, latest, and commit SHA tags
- Show published images
Key Design Decisions
Separate Docker Push Job
The Docker push steps were moved to a separate job because:
- The CI container doesn't have Docker commands available
- Docker operations require direct access to the host's Docker daemon
- This separation allows the CI job to run in a container while Docker operations run on the host
Job Dependencies
docker-pushdepends on bothbuild-cacheandci-pipeline- This ensures Docker images are only built after all tests pass
- The dependency hash from
build-cacheis used for consistent Docker builds
Conditional Execution
- Docker push only runs on
mainbranch (and temporarily onfeature/move-docker-jobfor testing) - All jobs skip if commit message contains
[skip ci] - All jobs skip if actor is
ci-botto prevent infinite loops