ื“ืœื’ ืœืชื•ื›ืŸ ื”ืจืืฉื™

CircleCI

CircleCI pipelines for building, testing, and deploying the API and webapp.

Configurationโ€‹

Located at .circleci/config.yml.

Pipeline Stagesโ€‹

1. Install Dependencies โ†’ yarn install
2. Lint โ†’ ESLint checks
3. Build โ†’ NX build api, webapp
4. Test โ†’ Unit tests, E2E tests
5. Docker โ†’ Build and push images
6. Deploy โ†’ Deploy to staging/production

Key Jobsโ€‹

JobPurpose
install-depsInstall and cache node_modules
lintRun ESLint across affected projects
build-apiBuild NestJS API
build-webappBuild Angular webapp
testRun unit tests
docker-buildBuild Docker images
deploy-stagingDeploy to staging environment
deploy-productionDeploy to production

Cachingโ€‹

CircleCI caches for faster builds:

- restore_cache:
keys:
- yarn-deps-{{ checksum "yarn.lock" }}
- yarn-deps-

- save_cache:
key: yarn-deps-{{ checksum "yarn.lock" }}
paths:
- node_modules
- ~/.cache/yarn

Environment Variablesโ€‹

Configure in CircleCI project settings:

VariablePurpose
DOCKER_USERNAMEContainer registry username
DOCKER_PASSWORDContainer registry password
NX_CLOUD_ACCESS_TOKENNX remote caching
STAGING_SSH_KEYSSH key for staging deploy

Workflow Filtersโ€‹

workflows:
build-and-deploy:
jobs:
- build-api:
filters:
branches:
only: [main, develop]
- deploy-staging:
requires: [build-api, build-webapp]
filters:
branches:
only: develop
- deploy-production:
requires: [build-api, build-webapp]
filters:
branches:
only: main