I have a monorepo setup and I want to introduce CI/CD into it using Github actions. I want a separate workflow for each service. So far, I have figured out that you can use path filtering to limit when an action is run BUT I have yet to figure out how to have the action run only on a specified folder/path.
This is my current structure:
mono-repo --
|
|- services --
| |- service1
| |- service2
|- .github --
|- workflows --
|- service1.yaml
|- service2.yaml
Any help is deeply appreciated. Thank you in advance.
Each step within a GitHub Actions workflow supports a parameter which sets the working directory for that step.
- name: build step
working-directory: ./src/foo
run: ...
Additionally, if your entire workflow takes place within a singular subdirectory, you can set the default working directory at the top level:
defaults:
run:
working-directory: ./src/foo