You can do this using NUnit MsBuild Community task by handling Output parameter "ExitCode" and then executing MSBuild Error Task depends on "ExitCode" or execute Deploy task/targets depends on this condition, so it is up to you.
Error task:
Stops a build and logs an error based on an evaluated conditional statement.
The Error task allows MSBuild projects issue error text to loggers and stop build execution
<!-- Build -->
<Build .... />
<!-- Run tests -->
<Nunit ....>
<Output TaskParameter="ExitCode"
PropertyName="NUnitResult" />
<!-- Stop build in case of error whilst tests run -->
<Error Text="Tests failed"
Code="$(NUnitResult)"
Condition="'$(NUnitResult)' != '0'"/>
<!-- Deploy -->
<Deploy Condition="'$(NUnitResult)' != '0'"/ ... />