CI/CD

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

Edit this page

Copyright © 2023-Present Ever Co. LTD.Docs by Sourcey