If folks are interested in this workflow, but want to auto-sync their changes to a GitHub repo, I’ve been maintaining a VS Code extension for managing code snippets, and notes/Roam-like wikis, and it includes full Foam interop:
https://aka.ms/GistPad.
I built this so that I could manage my knowledge in GitHub, but edit my notes like I would with Notion/OneNote (i.e. commit/push on save). It also supports managing code snippets via gists, since I’ve found that my personal knowledge is composed of notes and code snippets, and I wanted a single, editor-integrated solution for managing them both.