Our TeamCity process basically involves 3 "Build Configurations" that run in sequence:
- Build Step, triggered by source control (in our case GitHub): MSBuild builds everything, and creates one artifact containing all the unit test binaries, and several deployment package artifacts, one per website in the Visual Studio solution.
- Unit Test Step, triggered by the success of Step 1. This picks up the unit test binaries artifact and runs the unit tests.
- Deployment Steps, triggered by the success of Step 2. These each pick up the relevant deployment package artifacts and deploy them.
I've recently amended Step 1 to also pick up changes from Pull Request branches on GitHub, so that the Pull Request can be updated with the build result. I want to also run the Unit Tests for each Pull Request, but obviously not do any deploys in these cases.
So Step 1 has a Branch Filter to match the default branch or Pull Request branches. I can update the Trigger in Step 2 to also have this Branch Filter. However, the Triggers in the Deployment Steps do not have the option of a Branch Filter.
How can I only run the Deployment Steps for builds from the default branch?