Share rules across jobs

I have a pipeline with a number of steps, which are dependent.
I do also have a number of services which needs to be build correct before deploying any of them.

In my current setup do I have three jobs: build, publish and deploy. For our API I have copied the same rule across the three jobs.

Is it possible to have a shared rule block, where I can define a set of rules and use them in the individual jobs?

Have you considered using YAML Anchors? Looks complicated, but actually isn’t. Perhaps just looks a bit ugly. But IMO is a good first step towards templating and components (building reusable CI puzzles) :slight_smile:

1 Like