Multiple GitHub accounts on same computer but can't deploy Docusaurus website to GitHub pages using personal account - docusaurus

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.

Related

Azure Dev Ops Repository via NPM

I'm trying to figure out a way to have one repository that is my front-end code pulled into another repository that houses my application code. Both of these repos are hosted by Azure Dev Ops, however they are under different accounts (if that matters).
I have followed the directions I found on Microsoft's site for setting up the .npmrc file on my development machine, but I'm getting lost at how to structure my URL on the application site to pull in my front-end code package.
Everything I've tried has given me a authentication error so I must be missing something.
According your statements, I noticed that you need to pull the front-end code into your application code repository. Since these two repos are under different accounts and hosted by Azure Dev Ops.
We recommend you can try to Import the front-end code repository to your application code project. And then we can refer the doc: Check out multiple repositories in your pipeline.
Here are the detail steps:
Go to your front-end code repos and use the admin account to create a new PAT with full access.
Go to the application code project, then use the ‘Import repository’
Create a new pipeline and check out the both repos.
And for the authentication error, you can try to use the npm Authenticate task in your pipeline.

Github pages does not see CNAME or setup SSL?

I'm deploying an Angular application with this command:
ng deploy --base-href=https://fsalpha.fireflysemantics.com --cname=fsalpha.fireflysemantics.com
It works and this is the repository it's deployed to:
https://github.com/fireflysemantics/fsalpha
I have also setup A records so that the CNAME should work. In other words this url should work:
https://fsalpha.fireflysemantics.com
However after deploying the SSL checkbox does not enable inside Github Pages and the dialog section for Github Pages looks like this. Github pages did not picup the CNAME record and place the value in the custom domain field:
I've tried deleting and recreating the respository, but I'm not having any luck. Thoughts?
Turns out this happens when the first commit to gh-pages is done by a user with non admin privileges.
As long as the first commit is done by a user with admin privileges, future commits from both non admin and admin users will trigger the build.

How to switch Intellij Idea project vcs between Gitlab and Amazon CodeCommit?

I am new with Amazon codecommit.
Following their instruction, I did some works like below
make a new IAM user with AdministratorAccess
make a new codecommit repository
install awscli and did aws configure
When I right finished those things, I could pull/push from codecommit.
However it became disabled with intellij Idea.
I did something like...
I pull a project from gitlab
git remote rm origin
git remote add origin [code commit url]
git branch --set-upstream-to origin/master
Now I type git [pull / push] origin master, I got this error message.
unable to access 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/test17/': The requested URL returned error: 403
When I access this url via browser, it requires id/pw. But my IAM user account information is not working.
What should I do? Is there any way to switch gitlab and codecommit in intellij?
Thanks.
IntelliJ does not use awscli. It uses the default system shell.
From the description, it looks like push/pull does not work for the command-line git in the native shell, so the issue is not IntelliJ-related.
Probably git tries to use wrong credentials save in its credential.helper, that is why it fails.
Check git config credential.helper to see if any is configured. If there is one, try disabling it or clear the saved credentials.
From the description it looks like you are trying to connect to a CodeCommit repository in Intellij using https. To do this you need to generate GitCredentials(username/password) for your iam user in the IAM console.
Detailed steps are documented in the aws documentation: http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html
Once you have the username/password you can use those credentials to connect to your CodeCommit repository in Intellij.
Tested on a Mac. Your milage may vary!
I just ran into the same issue. MacOS stores the GIT UID and PW in the Keychain (in your Applications > Utilities Folder). I deleted all references to AWS Code Commit from the keychain, which forced me to reenter the UID & PW. This seems to have solve the problem.
As a side note: I think this happened because I revoked a prior GIT credential on AWS and created a new one. I think that the keychain was entering the old UID/PW which then failed during authentication.
First, you are going to want to create an IAM user with appropriate permissions and then create Git credentials. Then go to IntelliJ IDEA and say you are opening project from VCS with Git credentials, use the AWS git credentials you created and log in. Once you have logged in, you should be able to pull/push to the repo. If you are still having issues and have checked the credentials you are using are active, along with the IAM user those credentials are attached to have the right permissions, I would recommend creating a ticket on AWS support as there may be something wrong with your account that AWS staff will need to fix.

Can I import my heroku git repo into bitbuket? and how?

My laptop died and I need to code from another computer.
I am working with Heroku and I want to get the latest version of code from Heroku to another machine.
I understood that it is very recommended to get a proper remote repository using GitHub or BitBucket.
I decided to try BitBucket.
While creating my account, it asks for the old URL of my git repo. Since my machine is dead, I was hoping to fill in the heroku URL but that didn't work.
Any ideas how to proceed?
The idea is that I could pull and push my changes from either machines (when my laptop comes from repair).
You can simply clone your Heroku repository to your local machine. Then add BitBucket as a remote and push the code there.
Find out the Heroku repo url on the settings page of your app
https://dashboard.heroku.com/apps/[APP]/settings
git clone git#heroku.com:[APP].git
git remote add bitbucket ssh://git#bitbucket.org/[ACCOUNT]/[REPO].git
git push bitbucket master

Authentication failed publishing a repository from Github for Windows

I am trying out Github for Windows and I am getting the following error when I try to publish a newly created repository.
Authentication failed
Your credentials may be out of date. Please log out of the application and then log back in before retrying the operation.
Needless to say I've logged out and back in multiple times without success. I've also uninstalled and installed the latest version to no avail.
The repository is a new one I created within the application and contains only the .gitattributes, .git and README files.
I am a complete newbie to Github so it's quite possible I've messed something up during the setup process.
I was able to solve this by:
Press Settings - Open in GitShell.
git status
git push (or pull)
introduce credentials (here is the most important step, somehow git client messed up or forgot your credentials).
After giving correct credentials you can exit from git shell and use git client again.
It turns out that the problem was Github for Windows was having a problem with the password it had stored. Github support's instructions were as follows:
Log out of Github for Windows.
Change my password on github.com
Log back into Github for Windows.
I was then able to publish my changes.
Did you setup your ssh keys?
https://help.github.com/articles/generating-ssh-keys#platform-windows