Fixed the deploy target being executed on feature branches

Fixes #6251