Deploying a React App to GitHub Pages Step by Step Guide - Free

Опубликовано: 01 Февраль 2024
на канале: The Curious Minds
244
7

#githubpages #deploy #react

Welcome to comprehensive step-by-step guide on deploying a React app to GitHub Pages! 🚀 Whether you're a beginner or an experienced developer, this tutorial will walk you through the entire process, making it easy for you to showcase your React projects online.

Watch Timings:
00:00 DEPLOY REACT APP TO GITHUB PAGES
00:05 REACT APP INTIALIZATION
00:25 GITHUB CONFIGURATION CHANGES
00:53 GITHUB REPOSITORY/CONFIGURATION CHANGES
03:14 Frequent Update Handling

Create a React app
npx create-react-app my-app

Install the gh-pages and designate it as a development dependency:
npm install gh-pages --save-dev

In Package.json , add homepage attribute.
{
"name": "my-app",
"version": "0.1.0",
"homepage": "https://gitname.github.io/react-gh-pages",
"private": true,

and add predeploy and deploy
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",

Follow above video for deployment steps.