Skip to content

Hatchgrid CI/CD Workflow Guide

This guide describes how the GitHub Actions workflows are configured for Hatchgrid and how to maintain or extend them.


  • Monorepo CI (monorepo-ci.yml) - Main continuous integration pipeline
  • Backend CI (backend-ci.yml) - Backend-specific CI (Kotlin/Java)
  • Frontend CI (frontend-ci.yml) - Frontend-specific CI (Node.js/TypeScript)
  • Deploy (deploy.yml) - Deployment pipeline to different environments
  • Cleanup Cache (cleanup-cache.yml) - Automatic cache cleanup
  • Issue Labeler (issue-labeler.yml) - Automatic issue labeling
  • Semantic PR (semantic-pull-request.yml) - PR title validation
  • Test PNPM (test-pnpm.yml) - PNPM configuration testing

File: .github/workflows/monorepo-ci.yml

  • Push to main (excludes markdown files and specific workflows)
  • Pull requests (excludes markdown files and specific workflows)
  • Manual execution with environment selection
  • Automatically labels PRs based on modified paths
  • Uses actions/labeler@v5
  • Security analysis with CodeQL
  • Languages: javascript, kotlin
  • Uploads results to GitHub Security
  • Code validation with multiple linters
  • Configured with VALIDATE_ALL_CODEBASE: true
  • Scans PRs for dependency vulnerabilities
  • Automatically comments on PRs
  • OWASP security analysis
  • Fails if vulnerabilities with CVSS ≥ 7 are found
  • Generates HTML report as artifact
  • Runs delegated backend and frontend workflows
  • Runs in parallel to optimize time
  • Runs after backend and frontend
  • Downloads artifacts from both
  • Executes ./gradlew integrationTest
  • Uploads integration reports
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

File: .github/workflows/backend-ci.yml

  • Changes in server/**, shared/**, Gradle files
  • Push to main and pull requests
  • Runs static analysis with Detekt
  • Uses Reviewdog for PR comments
  • Generates SARIF reports
  • Compiles with Gradle (./gradlew build -x test)
  • Runs tests (./gradlew test)
  • Publishes test results
  • Uploads coverage to Codecov (Kover)
  • Generates artifacts (JARs and reports)
  • NVD_API_KEY - For vulnerability analysis

File: .github/workflows/frontend-ci.yml

  • Changes in client/**, Node.js configuration files
  • Push to main and pull requests
  • Linting with Biome
  • Automatic PR comments via Reviewdog
  • Configured to fail on errors
  • Compiles frontend applications (pnpm build)
  • Uploads build artifacts
  • Runs tests (pnpm test)
  • Uploads coverage to Codecov

File: .github/workflows/deploy.yml

  • Manual with environment selection (development, staging, production)
  • Push to main → automatic deployment to development
  • Tags v* → automatic deployment to production
  • Determines deployment environment based on trigger
  • Compiles backend with Gradle
  • Builds and pushes Docker image
  • Scans image with Trivy
  • Uploads security results
  • Compiles frontend with pnpm
  • Builds and pushes Docker image
  • Scans image with Trivy
  • Uploads security results
  • Configures kubectl
  • Updates Kubernetes manifests
  • Deploys to Kubernetes
  • Waits for deployment confirmation
concurrency:
group: deploy-${{ github.ref_name }}-${{ inputs.environment || 'development' }}
cancel-in-progress: false

  • Runs when a PR is closed
  • Automatically cleans branch caches
  • Uses GitHub CLI for cache management
  • Automatically labels issues when opened or edited
  • Configuration in .github/issue-labeler-config.yml
  • Validates PR titles according to Conventional Commits
  • Automatically comments if title is invalid
  • Removes comments when corrected
  • Test workflow for PNPM configuration
  • Manual execution only
  • Verifies installation and configuration

path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}

matrix:
language: [ 'javascript', 'kotlin', 'java' ]
  • Slack: slackapi/slack-github-action
  • Discord: custom webhook
  • Teams: skitionek/notify-microsoft-teams
  • Use specific versions with SHA hash
  • Review regularly with Dependabot
  • Test in development environment first

  • Each workflow has specific minimal permissions
  • contents: read by default
  • Additional permissions only when necessary
  • CodeQL for static analysis
  • OWASP Dependency Check for dependencies
  • Trivy for Docker images
  • Dependency Review for PRs
  • CODECOV_TOKEN - For uploading coverage
  • NVD_API_KEY - For vulnerability analysis
  • KUBECONFIG - For Kubernetes deployments