That's how I wrote and self-published my book as well!
Although, I created a script that turns md to epub/mobi/pdf using pandoc.
Here's how I did it in case anyone is interested: https://pascalprecht.github.io/posts/writing-an-ebook
Here's how I did it in case anyone is interested: https://pascalprecht.github.io/posts/writing-an-ebook