Check branches when deploying

See https://projects.aptivate.org/issues/3633 for details