Part 3: Building CI/CD Pipelines for TypeScript Microservices
Introduction
Project Structure
my-project/
βββ services/
β βββ auth/
β β βββ src/
β β βββ tests/
β β βββ prisma/
β β βββ package.json
β β βββ tsconfig.json
β βββ payment/
β βββ user/
β βββ notification/
βββ packages/
β βββ shared-types/
β βββ shared-utils/
β βββ eslint-config/
βββ .github/
β βββ workflows/
β βββ auth-ci.yml
β βββ payment-ci.yml
β βββ user-ci.yml
βββ package.jsonComplete CI Pipeline for TypeScript Service
Caching Dependencies
NPM Cache
Custom Cache for Multiple Paths
Prisma Client Cache
Matrix Builds
Testing with Different Databases
PostgreSQL with Extensions
Testing with MySQL
Environment-Specific Testing
Security Scanning
Dependency Scanning
Code Scanning with CodeQL
Docker Build Optimization
Multi-Stage Dockerfile
Workflow for Docker Build
Monorepo Workflow Optimization
Detect Changed Services
Parallel Jobs
Notification on Failure
Complete Package.json Scripts
Key Takeaways
PreviousPart 2: YAML Syntax and Workflow FundamentalsNextPart 4: Advanced Workflows and Optimization
Last updated