Even if you are still in the wrong, which it is. It doesn't mean you can't make amends and keep going afterwards.
The worst thing is mainly all of the guilt and sorrow that comes with these kinds of things, which is probably why your Ex, in a blind rage, made it public.
The thing is that yes you fucked up, yes you will get ostracised.
Depending on how it affects your current relationships going forward, you may need to publicly apologize (Your EX has the right not to accept it) or flee the area and try to find a new life. It's hard, and will be hard.
Try to become better, and think about what made you go up to that place, potentially get therapy or counselling.
Even if you're in the wrong, you're still a person and you can improve, learn, and get better.
(I will note that I have no personal experience in this, but am just trying to give my advice.)