Yes, it's possible to do this using the Github API.
The URL must be something like that:
https://api.github.com/repos/{repositoryName}/contents/{path}
repositoryName
is the repository where you want to put your file and path
its path within this repository.
Regarding the authentication, you need to follow this link https://developer.github.com/v3/#authentication. I successfully tested with basic auth.
You need then to use an HTTP method PUT
with content with the following structure:
{
"message": "a commit message",
"content": "bXkgbmV3IGZpbGUgY29udGVudHM="
}
The field content
corresponds to the content of your file encoded with base 64.
Hope it helps.
Thierry