
This week I took on the daunting task of trying to finally finish building my portfolio site 😱
The build itself wasn’t really the hard part for me, although I am still working on a few things in the background to make it better. For me, the “hard” part was/is getting it hosted on GitHub pages. I cannot tell you how many hours I have spent reading GitHub’s documentation on this subject only for it to fall flat for my particular use case.
For example, their documentation only deals with a GitHub Users Page that has not yet had a repository created for it, and then it only relates to having an index.html file where ‘you can put all your code’ that you want to be displayed on your page. I dunno about you, but I preferred to build mine locally and view it on my localhost while it’s originally in development; I didn’t want a half-built page showing up if anyone were to try and find a portfolio site for me. Their documentation doesn’t handle how to set up a user's page with an already existing repository.
So off to Google I went and welp there is another extremely long rabbit hole with many different twists and turns; most of which turned out to be dead ends it seemed. But I managed to find an article that seemed to lay everything out that I needed to do in a very orderly fashion and explained most things so that I could understand them, and so off I went to try and hook up my React app that I created for my portfolio to GitHub pages!
- in package.json add “homepage” property with the URL to be used ✔
- in package.json add the “predeploy” and “deploy” scripts ✔
- create a new branch called “source” ✔
- In repository on GitHub set pages default branch to new “source” branch ✔
- Run ‘npm run deploy’ while in source branch in editor ✔
With all of these steps completed, I should have a deployed portfolio on GitHub pages! But wait a minute…..my site is showing the auto-generated README.md file and not my portfolio! 😭😭😭
Back to Google I go! According to the most frequent answer in the round of research, it can take anywhere from a couple of minutes (been there and still waiting) to a couple of hours for GitHub to actually recognize the correct branch that you are trying to deploy from, and during that time it can, and most likely will, still show that readme file.
So here I am still waiting to see if my site will ever show up correctly. Hopefully, it won’t take very long, but rest assured if it doesn’t show up that I will be doing more research, and will try to update this post along the way!