circleci
Configure CircleCI workflows and orbs for continuous integration and deployment. Create config.yml pipelines, use orbs for reusable configurations, and optimize build performance. Use when working with CircleCI for CI/CD automation.
What this skill does
# CircleCI Build, test, and deploy applications using CircleCI's cloud-native CI/CD platform. ## When to Use This Skill Use this skill when: - Setting up CI/CD pipelines with CircleCI - Using orbs for reusable configuration - Optimizing build times with caching and parallelism - Configuring CircleCI workflows and approvals - Managing CircleCI contexts and secrets ## Prerequisites - CircleCI account connected to repository - Project enabled in CircleCI dashboard - Basic YAML understanding ## Configuration File Create `.circleci/config.yml`: ```yaml version: 2.1 orbs: node: circleci/[email protected] docker: circleci/[email protected] executors: default: docker: - image: cimg/node:20.10 working_directory: ~/project jobs: build: executor: default steps: - checkout - node/install-packages: pkg-manager: npm - run: name: Build application command: npm run build - persist_to_workspace: root: . paths: - dist test: executor: default steps: - checkout - node/install-packages: pkg-manager: npm - run: name: Run tests command: npm test deploy: executor: default steps: - checkout - attach_workspace: at: . - run: name: Deploy command: ./deploy.sh workflows: build-test-deploy: jobs: - build - test: requires: - build - deploy: requires: - test filters: branches: only: main ``` ## Executors ### Docker Executor ```yaml executors: node: docker: - image: cimg/node:20.10 - image: cimg/postgres:15.0 environment: POSTGRES_USER: test POSTGRES_DB: testdb working_directory: ~/app ``` ### Machine Executor ```yaml executors: linux-machine: machine: image: ubuntu-2204:current resource_class: large ``` ### macOS Executor ```yaml executors: macos: macos: xcode: "15.0.0" resource_class: macos.m1.medium.gen1 ``` ## Caching ### Dependency Caching ```yaml jobs: build: steps: - checkout - restore_cache: keys: - v1-deps-{{ checksum "package-lock.json" }} - v1-deps- - run: npm ci - save_cache: key: v1-deps-{{ checksum "package-lock.json" }} paths: - node_modules ``` ### Multi-Key Caching ```yaml - restore_cache: keys: - v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - v1-{{ .Branch }}- - v1-main- - v1- ``` ## Workspaces ### Persist Data ```yaml jobs: build: steps: - checkout - run: npm run build - persist_to_workspace: root: . paths: - dist - node_modules deploy: steps: - attach_workspace: at: ~/project - run: ./deploy.sh ``` ## Parallelism ### Test Splitting ```yaml jobs: test: parallelism: 4 steps: - checkout - run: name: Run tests command: | TESTFILES=$(circleci tests glob "test/**/*.test.js" | circleci tests split --split-by=timings) npm test -- $TESTFILES - store_test_results: path: test-results ``` ## Workflows ### Sequential Jobs ```yaml workflows: pipeline: jobs: - build - test: requires: - build - deploy: requires: - test ``` ### Parallel Jobs ```yaml workflows: pipeline: jobs: - build - test-unit: requires: - build - test-integration: requires: - build - deploy: requires: - test-unit - test-integration ``` ### Manual Approval ```yaml workflows: deploy-prod: jobs: - build - test - hold: type: approval requires: - test - deploy-production: requires: - hold ``` ### Scheduled Workflows ```yaml workflows: nightly: triggers: - schedule: cron: "0 2 * * *" filters: branches: only: - main jobs: - build - test ``` ### Branch Filtering ```yaml workflows: build-deploy: jobs: - build: filters: branches: only: - main - /feature-.*/ - deploy: filters: branches: only: main tags: only: /^v.*/ ``` ## Orbs ### Using Orbs ```yaml version: 2.1 orbs: aws-cli: circleci/[email protected] kubernetes: circleci/[email protected] jobs: deploy: executor: aws-cli/default steps: - aws-cli/setup: aws_access_key_id: AWS_ACCESS_KEY_ID aws_secret_access_key: AWS_SECRET_ACCESS_KEY - kubernetes/install-kubectl - run: kubectl apply -f k8s/ ``` ### Common Orbs ```yaml orbs: node: circleci/[email protected] # Node.js docker: circleci/[email protected] # Docker builds aws-cli: circleci/[email protected] # AWS CLI aws-ecr: circleci/[email protected] # ECR push aws-ecs: circleci/[email protected] # ECS deploy gcp-cli: circleci/[email protected] # GCP CLI kubernetes: circleci/[email protected] # K8s deploy slack: circleci/[email protected] # Notifications ``` ## Docker Builds ```yaml version: 2.1 orbs: docker: circleci/[email protected] jobs: build-and-push: executor: docker/docker steps: - setup_remote_docker: version: 20.10.24 - checkout - docker/check - docker/build: image: myorg/myapp tag: $CIRCLE_SHA1 - docker/push: image: myorg/myapp tag: $CIRCLE_SHA1 ``` ## Environment Variables ### Project Variables Set in CircleCI Project Settings > Environment Variables ### Contexts ```yaml workflows: deploy: jobs: - deploy-staging: context: staging-secrets - deploy-production: context: production-secrets ``` ### Using Variables ```yaml jobs: deploy: steps: - run: name: Deploy command: | aws s3 sync dist/ s3://$S3_BUCKET environment: AWS_DEFAULT_REGION: us-east-1 ``` ## Artifacts and Test Results ```yaml jobs: test: steps: - run: name: Run tests command: npm test -- --coverage - store_test_results: path: test-results - store_artifacts: path: coverage destination: coverage-report ``` ## Resource Classes ```yaml jobs: build: docker: - image: cimg/node:20.10 resource_class: large # 4 vCPU, 8GB RAM steps: - checkout - run: npm run build # Available classes: # small: 1 vCPU, 2GB RAM # medium: 2 vCPU, 4GB RAM (default) # large: 4 vCPU, 8GB RAM # xlarge: 8 vCPU, 16GB RAM ``` ## Common Issues ### Issue: Cache Not Restoring **Problem**: Cache misses on every build **Solution**: Verify cache key format, ensure checksum file hasn't changed ### Issue: Workspace Attach Fails **Problem**: Cannot find persisted workspace **Solution**: Ensure persist_to_workspace job completed, check paths ### Issue: Docker Layer Caching **Problem**: Docker builds are slow **Solution**: Enable Docker Layer Caching in project settings (paid feature) ## Best Practices - Use orbs for common tasks - Implement aggressive caching strategies - Use workspaces for sharing data between jobs - Split tests with parallelism for faster builds - Use contexts for environment-specific secrets - Define reusable executors - Store test results for insights ## Related Skills - [github-actions](../github-actions/) - GitHub CI/CD - [docker-management](../../containers/docker-management/) - Container builds - [aws-ecs-fargate](../../../infrastructure/cloud-aws/aws-e
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.