Publish free on GITHUB PAGES

Bibek Prasad
1 min readApr 1, 2020

--

There are few free hosting sites for static webpages(HTML,CSS,Javascript), they are NETLIFY and GITHUB.

HEROKU is generally used for hosting Dynamic pages involving some backend like Nodejs, Expressjs.

Let suppose we want to host a React app .

First Create a React app->

From the command Terminal Run:

npm i gh-pages

Install github pages ->

npm i gh-pages (This will create a path in package.json)

set homepage:”url ”

“predeploy”: “npm run build”,
“deploy”: “gh-pages -d build

Push the code to github master=>

Git init (Initialize the repo)->git add.->git commit -m””->git add remote origin “repo link(https:/…)”->git push -u origin master

Build and Run=>

npm run build(it will build the project)…A build folder will created

npm run deploy(it will deploy the build version).

Build publish.

Open the homepage link ,the build will be published there.

#netlify #githubpages #github #apps #webapp #hosting

--

--