Leanpub is a great platform for self-publishing: https://leanpub.com It has multiple input (.doc, GitHub, ...) and output sources (PDF, EPUB, MOBI). In the end, you can publish the book on their platform or simply use the files for your own platform or Amazon.