Public repos have brought me some great gigs. No luck involved, it just makes some people want to hire you. Ironically, the quality of the work I've produced -and had to deal with- at those gigs has not been as good as my personal projects. Literally every SaaS seems to be riddled with technical debt that takes man-decades to pay off, and moderate to extreme turnover. Publishing your work increases your chances of getting a well paid position, but not necessarily an enjoyable or stable one.
The last two jobs I've got have been where they contacted me after seeing some code/writing/work I published or spoke about in public.
I've been careful about contracts to ensure that I can continue publishing my own stuff (even if there's overlap with work related stuff) on my own time - publishing semi regularly is a pretty solid hedge against future long term unemployment.