Non-fiction is easier to sell, if it provides value. You can charge higher prices for programming books than for mysteries, and people will pay because the knowledge they gain from the book will be worth the money.
If your goal is to earn money from writing, please know that even if you produce excellent work, marketing is key. Identify your audience and find ways to connect to them. Have at least a minimal marketing plan in place before you publish.
The post mentioned by surprisetalk, https://news.ycombinator.com/item?id=34250688, was posted about the same time as yours. That guy had a (very) minimal marketing plan, and it worked out pretty well for a first book.
I'm also publishing free content at https://taylor.town
> I don't think it's worth it to publish free content anymore
If "worth it" means "make you rich", I wouldn't recommend pursuing writing :)
If "worth it" means "provides meaning to yourself and others", books and blogs will continue to be enriching!
---
EDIT: Just noticed a new thread describing the 2022 earnings of a self-published book of "4 years worth of SRE blog posts": https://news.ycombinator.com/item?id=34250688