CI/CD
Continuous Integration and Deployment pipelines.
We recommend using GitHub Actions for CI/CD pipelines to ensure code quality and automate deployments.
Workflows
Pull Request Checks
Triggered on pull requests to main or develop.
- Lint: Runs
pnpm lintto check for code style issues. - Test: Runs
pnpm testto execute unit tests. - Build: Runs
pnpm buildto ensure the application compiles correctly.
Deployment
Triggered on push to main or release tags.
- Build Docker Images: Builds images for API and Frontends.
- Push to Registry: Pushes to ECR or Docker Hub.
- Deploy: Updates the Kubernetes cluster or AWS CDK stack.
Client Application Deployment
We have a dedicated workflow deploy-clients.yaml that deploys the frontend applications to AWS S3 and invalidates CloudFront caches. This workflow triggers automatically after a successful Build / Lint / Test run.
Configuration
To enable this workflow, you must configure the following Variables in your GitHub Repository Environment. This workflow uses AWS OIDC authentication for improved security.
Variables:
AWS_REGION: The AWS region (e.g.,us-east-1).PIPELINE_ROLE_ARN: The ARN of the IAM Role created for the pipeline (e.g.,arn:aws:iam::123456789012:role/PipelineStack-PipelineRole...).CLIENTS_BUCKET: The name of the S3 bucket created by CDK (e.g.,client-side-atlas-bucket-cdn).DISTRIBUTION_ID_ACCOUNTS: The CloudFront Distribution ID for the Accounts app.DISTRIBUTION_ID_APP: The CloudFront Distribution ID for the main App.
Retrieving Values
After deploying the infrastructure using CDK (pnpm deploy:clients and pnpm deploy:pipeline), check the CloudFormation outputs in the AWS Console or the CLI output for:
PipelineStack.PipelineRoleArn-> Use forPIPELINE_ROLE_ARNClientsStack.AppDistributionDistributionId-> Use forDISTRIBUTION_ID_APPClientsStack.AccountsDistributionDistributionId-> Use forDISTRIBUTION_ID_ACCOUNTS- The bucket name can be found in
infra/aws/stacks/clients-stack.tsor the CloudFormation resources.
Turborepo Optimization
Our pipelines leverage Turborepo's caching mechanisms. If a commit only affects apps/docs, the pipeline will skip testing and building apps/api, significantly reducing CI time.