You were only young, just 18 and made the best decision you felt you could at the time. I get that your partner is shocked (if you're close enough to want him as the father of your baby it might've been an idea to tell him before now) but I hope he gets over it as it's not the be all and end all of everything.
Essentially, what actual difference will it make to him personally who your child's father is?
How can we all know whether or not someone we love or loved, has told a pretty big lie in their life, way before we met them? You just never know.
I'd hope he doesn't see himself as moral judge and jury in this situation because that really should not be his role, even if he is shocked. You made a rash decision when you were 18, thats not last year is it?
If he can't forgive you well then, you'd simply have to let him go.
You need to tell your child now though, thats the main thing.
It's probably best to ignore the pitchfork saints on here, but do read posts from people who've been in the situation (shock) of finding out the person they thought was their dad, actually isn't. They're best placed to tell you how to proceed with this, and what the possible outcome may be
💐to anyone who's gone through this. When my aunt died my uncle threw their son out telling him "you're not mine". My cousin always thought that was his dad. He was never told differently. He was angry and aggressive and resentful as both boy and man. He never made it to old age. I think you should tell sooner rather than later OP. Good luck.