0

I have two GitHub accounts set up on my computer. I followed the steps as defined here to create multiple SSH keypairs. I am able to work on multiple repos from different GitHub accounts.

Using my default (work) account I can successfully deploy my Docusaurus website using both approaches: HTTPS & SSH. But when using my personal GitHub account I can not deploy a Docusurus website to GitHub pages. The steps I am following:

git clone git git@github.com-personal:USER/repo-name.git

Next, I locally configure my username & email for git.

Create the template website (i.e. npx @docusaurus/init@latest init my-website classic). Update the docusaurus.config.js file, etc.

When deploying:

DEPLOYMENT_BRANCH=docsites-pages GIT_USER=Username USE_SSH=true yarn deploy

Everything works until the CMD: git commit -m "Deploy website -based on abx..." is executed. The error message:

ERROR: Permission to username/username.github.io.git is denied to OtherUserName

The OtherUserName is my GitHub work account, which is the default in the ~/.ssh config file.

THE PROBLEM - Docusaurus is using the wrong account (i.e. OtherUserName) when attempting to push the generated website to the branch.

Note, that I am using a GitHub pages User site vs a Project site.

0 Answers0