5 Steps to Deploy Vite React App on GitHub

Posted by






Deploy Vite React App on GitHub in 5 Steps

Deploy Vite React App on GitHub in 5 Steps

If you have developed a React app using Vite and now you want to deploy it on GitHub, you’re in luck! Here’s a step-by-step guide to help you deploy your Vite React app on GitHub in just 5 easy steps.

Step 1: Build your Vite React app

First, you need to build your Vite React app using the following command:

vite build

Step 2: Create a new GitHub repository

Create a new repository on GitHub where you will deploy your Vite React app. You can do this by going to your GitHub account and clicking on the “New repository” button.

Step 3: Push your Vite React app to GitHub

After creating the repository, you need to push your Vite React app to GitHub using the following commands:

git remote add origin https://github.com/your-username/your-repository.git
git branch -M main
git push -u origin main

Step 4: Install GitHub Pages package

Next, you need to install the GitHub Pages package to deploy your Vite React app on GitHub. You can do this by running the following command:

npm install gh-pages --save-dev

Step 5: Deploy your Vite React app

Finally, you need to deploy your Vite React app on GitHub using the following commands:

npm run build
npm run deploy

And that’s it! Your Vite React app is now deployed on GitHub for the world to see.


0 0 votes
Article Rating
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
wulu027
7 months ago

working 100%

Mr. A
7 months ago

Thanks bro. I had difficult looking for working solution I watched many tutorial on how for a few hours and this is the only one worked!! Great Job! :>

Hehebe Hello
7 months ago

thanks bro we react learners have to help each other out lol

zeninja
7 months ago

nice video it helped