Wasn't the best promotion, but I did manage to sell out half of the printed books (~500/1000, book readership in Lithuania isn't huge) this way.
Nowaday I would also use Google/Facebook ads. It would cost a bit, but it should still be profit. (With an added bonus of using those ads as self promotion for your name, useful for your later books.)
1. Twitter. My audience is pretty small. 2. I created a YouTube channel [1] and recorded some videos around topics from the book. I linked to the book in the description and mentioned it at the start of the videos. 3. I put a small advertisement on another free ebook I wrote that relates the same topic [2].
I've sold a couple hundred copies and made about $5k. And I get to say I'm an author!
[0] https://lachlanmiller.gumroad.com/l/vuejs-design-patterns [1] https://www.youtube.com/c/lachlanmiller [2] https://lmiller1990.github.io/vue-testing-handbook/v3/