The second blocker to deploying my website related to authentication errors with github. This post details what I did to fix those issues to deploy my wesite via Github Pages. The following information is only applicable to MacOS and Linux users. (Review the first blocker here.)
On July 30, 2020, GitHub Security published this article announcing that GitHub will no longer be using passwords when authenticating with REST APIs on GitHub.com and developers can begin using token-based authentication on November 2020. A December 15, 2020 article was subsequently published providing more information, including the announcement that passwords will no longer be accepted when authenticating on August 13, 2021 and after.
August 13 was pretty recent to the date I deployed/published my site, and I had not known about it, so it caused me some confusion.
Basically, I kept receiving this error when attempting to push my build to the gh-pages branch (to publish my website):
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/myUsername/myRepo.git/'
In hindsight, this isn't as much of a catastrophic issue as the previous build issue, but I figured this walkthrough could be helpful for some.
Note: if your repositories use SSH, you can authenticate via SSH keys.
Alright - first, follow these steps to create a personal access token.
After token generation, you will need to open your terminal and enter these commands:
$ git config --global user.name "githubUsername"
$ git config --global user.email "githubEmailAddress"
$ git remote set-url origin https://<tokenStream>@github.com/<githubUsername>/<reponame>.git
After these changes, you should be able to push to the publishing branch!