So last Thursday night I couldn’t sleep, and after a few minutes of losing a starring contest with the wall I decided this was the perfect opportunity to try deploying an app on Github Pages. (true story)

Let me preface by saying it’ll prob take me longer to type this article up than it did to deploy my app. BOLD statement I know! Quote me on it I’m ready.

Creating the App Step 1

I’m going to make few assumptions here. One, that you have a github account and two, that you know how to set up a repo. Full disclosure this is a React App walk through. However it’s pretty straightforward and most steps are transferable or intuitive when moving to another setup.

First step make a github repo for your app. Your repo name will become part of your URL so name accordingly. Also unless you’re paying for github, this repo has to remain public to work.

To test github pages, you can fire up almost any application I decided to make a quick Portfolio Website for myself using** create-react app**. You can also just deploy a simple html boiler plate even. This served as great draft for an actual Portfolio I plan on moving to my own domain in a few days. Finished product:

Coral Fussman

Coral Fussman’s portfolio

coralfussman.github.io

The key here is that once your app is done or at a point where you’re ready to deploy, make sure the app is already pushed up to github.

Deploying the App Step 2

How exciting! Your app is up and running, let’s go! First thing you need to do is add gh-pages to your dependencies. In your terminal run:

use npm install gh-pages — save-dev

I also took this app as an opportunity to use yarn as my dependency manager, if you’re doing the same the docs say to use yarn add gh-pagesbut I found that I needed to use the above flags, so if you run into an issue installing use

yarn add gh-pages — save-dev .

Okay great job we’re almost there. Now go back to your github repo and click on settings.

#github #react #software-development #programming #github-pages

Deploy Github Pages in Minutes
1.20 GEEK