(Umpteenth time:) GitHub is not about just publishing source code; with git, it's trivial out of the box.
GitHub's value is in the PR process, in CI/CD, releases, the issue tracker, and an identity system propping all of that. This is the thing to replace, and it's quite a bit harder.