<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vibha Mishra</title>
    <description>The latest articles on DEV Community by Vibha Mishra (@vibhamishra07).</description>
    <link>https://dev.to/vibhamishra07</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F931577%2F7f0b6af9-9873-490a-8777-1b3ae709a62f.png</url>
      <title>DEV Community: Vibha Mishra</title>
      <link>https://dev.to/vibhamishra07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vibhamishra07"/>
    <language>en</language>
    <item>
      <title>Simple And Easy Way to Deploy React App On GitHub Pages</title>
      <dc:creator>Vibha Mishra</dc:creator>
      <pubDate>Sat, 24 Sep 2022 15:20:05 +0000</pubDate>
      <link>https://dev.to/vibhamishra07/simple-and-easy-way-to-deploy-react-app-on-github-pages-5e7a</link>
      <guid>https://dev.to/vibhamishra07/simple-and-easy-way-to-deploy-react-app-on-github-pages-5e7a</guid>
      <description>&lt;p&gt;When we build a React app then we eagerly want to deploy it and want to show our amazing app to the world.&lt;br&gt;
And here, are the simple steps to deploy React app on GitHub Pages.&lt;/p&gt;
&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You should have a GitHub account
(If you don't have GitHub account then go in to &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt; and create a new account.)&lt;/li&gt;
&lt;li&gt;Make sure &lt;a href="https://nodejs.org/en/download/"&gt;Node and npm&lt;/a&gt; are 
installed in your system.&lt;/li&gt;
&lt;li&gt;And you should have one React project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is GitHub Pages?&lt;/strong&gt;&lt;br&gt;
GitHub pages is a service provided by GitHub to publish a static website on GitHub. You add Html, CSS and JavaScript files on a GitHub repository and GitHub pages turns it into a static website.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;u&gt;Steps for deploy React app on GitHub Pages:&lt;/u&gt;
&lt;/h2&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1:&lt;/strong&gt; Create a GitHub repository on &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt; Account.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go in to your GitHub account, and click on the + icon in the top right corner and then click on the New repository for creating a new repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vcwTnBx3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpixi6ksm5uhljk3dm90.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vcwTnBx3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpixi6ksm5uhljk3dm90.PNG" alt="GitHub account" width="383" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now give a name for your project in Repository name field as I give it a name "First-react-app" you can give any name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zWGvO3qC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7q72z2wgodpx08cm0bl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zWGvO3qC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7q72z2wgodpx08cm0bl.PNG" alt="GitHub account" width="742" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then click on create repository button, it will create your repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pJ3M9KJ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8syq9nknh8eeyv0xg5m.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pJ3M9KJ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8syq9nknh8eeyv0xg5m.PNG" alt="GitHub account" width="856" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After your repository is created, you can see this page on your screen&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gUSrl_eD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dbmi401y40eukrketzc8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gUSrl_eD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dbmi401y40eukrketzc8.PNG" alt="GitHub account" width="880" height="412"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After creating a GitHub repository, Go in to your terminal and open your react project directory in your terminal.&lt;br&gt;
&lt;code&gt;cd react_app&lt;/code&gt;&lt;br&gt;
here react_app is my folder name where i have created react app.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3:&lt;/strong&gt; Adding the GitHub Page dependency package.
&lt;/h3&gt;

&lt;p&gt;Run the following command in your terminal:&lt;br&gt;
for installing GitHub Pages package as a dev dependency via npm.&lt;br&gt;
&lt;code&gt;npm install gh-pages --save-dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After installing you can see the dev dependency in your package.json file as shown in this image.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cCPY01K4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l537wphdako1m8s17o8a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cCPY01K4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l537wphdako1m8s17o8a.PNG" alt="GitHub account" width="302" height="282"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4:&lt;/strong&gt; Adding the homepage in package.json file.
&lt;/h3&gt;

&lt;p&gt;Now, Go into your package.json file in your react app folder and add the following homepage.&lt;br&gt;
&lt;code&gt;"homepage": "https://myusername.github.io/my-app",&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; In place of "myusername" put the user name of your GitHub account and in place of "my-app" put the repository name which you have created earlier then save the package.json file.&lt;br&gt;
As my repository name is "First-react-app".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cGfRJb8M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ia8m0tzn4pccmstn401a.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cGfRJb8M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ia8m0tzn4pccmstn401a.PNG" alt="GitHub account" width="551" height="296"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5:&lt;/strong&gt; Adding the deploy scripts in package.json file.
&lt;/h3&gt;

&lt;p&gt;Now, scroll down in your package.json file and in scripts section put the following scripts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"predeploy": "npm run build",
"deploy": "gh-pages -d build",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sBXHvHam--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yoaeede5ggr13q38fyuh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sBXHvHam--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yoaeede5ggr13q38fyuh.PNG" alt="GitHub account" width="310" height="161"&gt;&lt;/a&gt;&lt;br&gt;
And then save the file.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6:&lt;/strong&gt; Now run the following commands in your terminal.
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git init&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git add -A&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git commit -m "First commit"&lt;/code&gt;&lt;br&gt;
(In place of First commit you can write any message)&lt;br&gt;
&lt;code&gt;git branch -M main&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git remote add origin https://github.com/your_username/your_repository_name.git&lt;/code&gt;&lt;br&gt;
(Here, in place of your_username put your username of GitHub account and in place of your_repository_name put your repository name)&lt;br&gt;
&lt;code&gt;npm run deploy&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 7:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Go into your GitHub repository and refresh that page until you don't get a tick mark as shown in this picture:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wxeiCcTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tv6h609mphbab6ukwfj2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wxeiCcTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tv6h609mphbab6ukwfj2.PNG" alt="GitHub account" width="878" height="128"&gt;&lt;/a&gt;&lt;br&gt;
And then go to settings in your GitHub account and then go to pages which is located in left corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jQSoN40F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b83ibk1xxlb8oyramvwv.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jQSoN40F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b83ibk1xxlb8oyramvwv.PNG" alt="GitHub account" width="320" height="506"&gt;&lt;/a&gt;&lt;br&gt;
And congratulations :) you can see your react app is deployed and you get your live link for your react app.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LdfmmdRY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cd5fj1iolu60a7ymnmcf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LdfmmdRY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cd5fj1iolu60a7ymnmcf.PNG" alt="GitHub account" width="837" height="310"&gt;&lt;/a&gt;&lt;br&gt;
After that click on visit site button to see your website :).&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;You can also watch this video for your help.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/9cyNWTSVkXk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>github</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
