#CircleCI
Cloud-native CI/CD platform.
#Configuration
yaml
1# .circleci/config.yml
2version: 2.1
3
4orbs:
5 node: circleci/node@5.0
6
7jobs:
8 build-and-test:
9 docker:
10 - image: cimg/node:20.0
11 steps:
12 - checkout
13 - node/install-packages
14 - run:
15 name: Run tests
16 command: npm test
17 - run:
18 name: Build
19 command: npm run build
20
21 deploy:
22 docker:
23 - image: cimg/base:current
24 steps:
25 - checkout
26 - run:
27 name: Deploy
28 command: |
29 echo "Deploying..."
30
31workflows:
32 build-test-deploy:
33 jobs:
34 - build-and-test
35 - deploy:
36 requires:
37 - build-and-test
38 filters:
39 branches:
40 only: main#Features
| Feature | Description |
|---|---|
| Orbs | Reusable packages |
| Parallelism | Split tests across containers |
| Caching | Speed up builds |
| Docker layer caching | Faster builds |
[!TIP] Pro Tip: Use orbs for common tasks like Docker builds!