Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 9 additions & 105 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,114 +1,18 @@
version: 2.1
# Define executors
executors:
node-executor:
docker:
- image: cimg/node:18.17
working_directory: ~/project
# Define jobs
jobs:
# Job that always runs
test:
executor: node-executor
steps:
- checkout
- run:
name: Run tests
command: echo "run test"
- run:
name: Run linting
command: echo "run linting"

# Job that always runs
build:
executor: node-executor
jobs:
test-coordinator:
type: no-op
test-unit:
docker:
- image: cimg/node:20.10
steps:
- checkout

- run:
name: Run tests
command: echo "run test"
- run:
name: Run linting
command: echo "run linting"

# Conditional job - only runs on main branch
deploy:
executor: node-executor
steps:

- run:
name: Deploy to production
command: |
echo "Deploying to production..."
# Add your deployment commands here
# e.g., aws s3 sync dist/ s3://my-bucket/
# e.g., kubectl apply -f k8s/
echo "Deployment completed!"

# Another conditional job - only runs on feature branches
integration-test:
executor: node-executor
steps:
- run:
name: Run integration tests
command: |
echo "Running integration tests..."
# Add integration test commands here


# Define workflows
workflows:
version: 2
build-test-deploy:
jobs:
# These jobs run on every commit
- test
- build:
requires:
- test

# Conditional job: Deploy only runs on main branch
- deploy:
requires:
- build
filters:
branches:
only: main

# Conditional job: Integration tests only run on feature branches
- integration-test:
requires:
- build
filters:
branches:
ignore:
- main
- develop

# Alternative workflow that runs only on tags
release:
jobs:
- test:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- build:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- deploy:
requires:
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/

- test-coordinator
- test-unit
#test