Closed vyasakhilesh closed 9 months ago
Hey @vyasakhilesh -
I just tested this on two of my repos, and it works OK.
Note that in order to run this, you need to have at least write rights on the repo in question (you need to be able update branches). Can you double check your permissions?
Also, you may have to generate a GitHub token to use as a password for this process.
Thanks @matentzn , I was trying to do it using ssh-keys .. so do you need to include the token in the origin URL? Or simply in .github/token.txt file ? Does it ask for a username and password when update_docs tries to push code in the remote repo if you add in token.txt?
Yes, it does ask me for username and password.. If you want to get this working with token.txt: @gouttegd I never tried this, but is there anything @vyasakhilesh needs to do specifically?
I don’t think it would be possible to use a GitHub token for this. From what I can see, mkdocs gh-deploy
does not use the GitHub API (either directly or through gh
, the GitHub CLI tool). It only uses standard git
commands, which have nothing to do with GitHub API and won’t care about a GitHub token.
Standard git
commands know how to use a SSH key, but the problem here is that the command is run from within a Docker container, which does not have access to ~/.ssh
.
@vyasakhilesh : Is your SSH setup “complicated”? Like, do you use SSH agent with forwarding, or a private key stored on a physical token that you access through GnuPG or similar?
If you have a simple setup (like, a regular SSH key stored in ~/.ssh/id-rsa
), then you could try binding your ~/.ssh
directory to the /root/.ssh
directory within the container. That should be enough to allow git
to use your key. You can do that by adding the following to the run.sh.conf
file (create that file if you don’t already have one):
ODK_BINDS=~/.ssh:/root/.ssh:ro
As a workaround, are there known problems with using mkvdocs build
instead of mkvdocs gh-deploy
and then commit/PR the docs with the rest of the repo?
This way you don't have to authenticate yourself when updating the docs and you're sure that the repo is up to date with the docs.
@pfabry I did exactly that in the past, no problems at all. I do believe that mkdocs gh-deploy does not really create a commit though, it seems to overwrite the whole branch. At least it seems that way, see https://github.com/obophenotype/upheno/commits/gh-pages
@vyasakhilesh I am closing this now, but if this continues to be an issue please re-open!
While running below command from the host machine
Getting this error