Hi, yeah there should be a solution here. Have you seen the path filtering orb?
version: '2.1'
orbs:
path-filtering: circleci/path-filtering@0.0.1
workflows:
generate-config:
jobs:
- path-filtering/filter:
base-revision: main
config-path: .circleci/continue-config.yml
mapping: |
src/.* build-code true
doc/.* build-docs true
I pulled that from the example. So basically you can have a generated config that uses a bunch of advanced logic. So in the example above the first mapping
will fire if anything in the src/.*
regex is changed. If it does then it passes pipeline parameter build-code
a true
value. You could imagine in the continue config there’s a workflow with an when
attribute that’s set to false by default. But when path filtering orb detects a change in those folders then it changes it to true. And so a workflow for that path is kicked off from the continuation config.
version: '2.1'
parameters:
build-code:
type: boolean
default: false
build-docs:
type: boolean
default: false
workflows:
build-code-workflow:
when: << pipeline.parameters.build-code >>
jobs:
- build-code-job
build-docs-workflow:
when: << pipeline.parameters.build-docs >>
jobs:
- build-docs-job
So .circleci/continue-config.yml
might look something like that. And so you can create all kinds of mapping and parameters to fire off different kinds of steps or workflows based on something changing in a directory. Does that work for you?