Couldn\'t find anything in the github documentation and also here on SO. But I was wondering if there could be a http://foo.github.com
for a private repository
The page.github.com does mention:
Github Pages are hosted free and easily published through our site,
Without ever mentioning access control.
The GitHub page help doesn't mention any ACL either.
They are best managed in a gh-pages branch, and can be managed in their own submodule.
But again, without any restriction in term of visibility once published by GitHub.
You could host password in a repository and then just hide the page behind hidden address, that is derived from that password. This is not a very secure way, but it is simple.
Demonstration
I had raised a support ticket against Github and got a response confirming the fact that ALL pages are public. I've now requested them to add a note to help.github.com/pages.
There is an article with a working idea on how to request oAuth authorization before loading static content dynamically:
Securing Site That Runs on Github Pages With JSON Backend In Private Repository
Content should be stored in a secret GitHub repository with a viewer having read access to it. GitHub pages stores only the serving JS code.
If you press admin on a private repo and scroll down to the part about pages, it writes that it'll be public. I'll check later if .htaccess control or similar is possible, but I don't have much hope for it.
At the moment it is not possible to do that.
However, in the official GitHub public roadmap we can see that this will finally be implemented in Q4 / 2020 for Enterprise Cloud customers.
From the issue description:
Intended Outcome
In cases where organizations want to build an intranet site or publish internal documentation, private pages will allow organization to keep the content private to their organizations.