Ex and new baby

Me and my ex boyfriend broke up a little while ago and I just found out I’m pregnant I told him and we are both happy, but any advice on how to be civil and okay with being around each other without getting back together, there’s also so much sexual tension and we have been sleeping together for a while as both of us need the sex, but should I cut it off completely and save the heartbreak or carry on and see if we can make it work again?