If you want something to live on the web long after you've lost interest in it static HTML/GitHub pages seems like the way to go. The chess board I built in high school to learn JavaScript is still going strong: https://github.com/PJ-Finlay/JavaScript-Chess-Board
Per the timestamp, that's ~5 years. I've got a personal domain I've had for 20 years now. GitHub wasn't there, and I wouldn't bet a whole lot it will be there in another 20. I think it's likely, but nothing close to guaranteed. Git didn't exist then, either.
It's pretty easy to mirror your own git repos, so that's a nice option, and to have stuff hosted on GitHub, your own, and maybe BitBucket as well. But nothing is going to beat having your own backups--which I DO still have, from as early as 2000.