๐ŸŒ
Medium
medium.com โ€บ @akhshyganesh โ€บ deploy-your-react-app-built-with-vite-on-github-pages-the-easy-way-668790061711
Deploy Your React App (Built with Vite) on GitHub Pages The Easy Way! | by Akhshy Ganesh | Medium
October 7, 2025 - "scripts": { "dev": "vite", "build": ... For GitHub Pages to serve your app correctly, you need to specify the base URL โ€” which should match your GitHub repository name....
๐ŸŒ
Medium
medium.com โ€บ @devxprite โ€บ how-to-deploy-vite-react-app-to-github-pages-00e150f73961
How to deploy Vite React App to GitHub Pages | by Prateek Singh | Medium
April 29, 2024 - To begin, make sure you have Node.js installed on your machine. You can then create a new React project by running the following command in your terminal: npm create vite my-project cd my-project npm install npm run dev
Discussions

Deploying First Vite Project on GitHub Pages
However, when I build and deploy my project for "gh-pages", a new branch is created which only contains a "dist" folder. Yes this is the intention. When deploying to Github Pages, the `gh-pages` branch is a "special" branch that just contains your build output so that Github Pages can read and serve it. More on reddit.com
๐ŸŒ r/reactjs
5
0
June 12, 2024
reactjs - Blank page when deploying a react app to github pages and vite - Stack Overflow
The page I am trying to deploy is here: LINK I don't know if it matters but I am currently using the free domain given to me by GitHub: www.elvas.me ยท I tried following the react official docs: Link, but it didn't work for me... Perhaps it's because I am using vite and not create-react-app? More on stackoverflow.com
๐ŸŒ stackoverflow.com
Deploying a Vanilla React App w Vite tooling to GitHub pages
Necessary? No. But it makes things braindead simple, and it'll work automatically on pushes to github. It's alot less work and alot harder to break than the alternative of manual uploads of builds https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site I haven't run the build command in years, but it just works once you say "hey deploy the page whenever main changes please" More on reddit.com
๐ŸŒ r/reactjs
3
1
March 26, 2025
How do I host my react app that was created using Vite on Github pages? I can only find methods to hose on GitHub pages if itโ€™s created with create react app. Any help? Or would yโ€™all recommend using Vercel or something? What are the differences?
Maybe this helps: https://vitejs.dev/guide/static-deploy.html#github-pages More on reddit.com
๐ŸŒ r/react
5
6
February 20, 2023
๐ŸŒ
GitHub
github.com โ€บ sitek94 โ€บ vite-deploy-demo
GitHub - sitek94/vite-deploy-demo: Deploy Vite app to GitHub Pages using GitHub Actions ยท GitHub
To host the app, go to Pages Settings, set Source to gh-pages, and hit Save. After a while your app should be deployed and be available at the link displayed in Pages Settings.
Author: sitek94
๐ŸŒ
GitConnected
levelup.gitconnected.com โ€บ deploy-your-vite-app-to-github-pages-a-lazy-devs-guide-37b0b472fa35
Vite to live in 5 minutes! The Lazy Devโ€™s Guide to GitHub Pages | by Deepak Surya | Level Up Coding
April 2, 2025 - import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], base: "/my-vite-site/" }); ... This package handles deployments for you.
๐ŸŒ
GitHub
github.com โ€บ ErickKS โ€บ vite-deploy
GitHub - ErickKS/vite-deploy: Guide for vite react app deploy ยท GitHub
name: Deploy on: push: branches: - main jobs: build: name: Build runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v3 - name: Setup Node uses: actions/setup-node@v3 - name: Install dependencies uses: bahmutov/npm-install@v1 - name: Build project run: npm run build - name: Upload production-ready build files uses: actions/upload-artifact@v3 with: name: production-files path: ./dist deploy: name: Deploy needs: build runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - name: Download artifact uses: actions/download-artifact@v3 with: name: production-files path: ./dist - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist
Author: ErickKS
๐ŸŒ
Medium
nikujais.medium.com โ€บ deploy-your-vite-react-app-on-github-pages-b52b2ad1edd2
Deploy your Vite + React app on GitHub Pages | by Nikita Jaiswal | Medium
October 17, 2025 - Head to your GitHub repo and navigate to Settings > Pages. Under Build and Deployment, make sure the settings are: ... You can set up GitHub Actions to automatically deploy your app every time you push to the main branch.
๐ŸŒ
DEV Community
dev.to โ€บ rashidshamloo โ€บ deploying-vite-react-app-to-github-pages-35hf
Deploying Vite / React App to GitHub Pages - DEV Community
April 15, 2023 - Change YOUR_REPOSITORY_NAME to the name of your GitHub repository. ... ๐ŸŽ‰ You now have a gh-pages branch in your repository and your app is deployed (you can check it under Settings -> Pages ) P.S. To update your app deployment, just run the ...
๐ŸŒ
Medium
medium.com โ€บ @badreddine.boudaoud21 โ€บ create-a-react-app-with-vite-and-deploy-it-on-github-48b82e19f821
Create a React app with Vite and deploy it on GitHub | by Badreddine Boudaoud | Medium
February 11, 2024 - Deploying a React app to GitHub Pages using the โ€˜gh-Pagesโ€™ package is a simple and convenient way to share your work with others.
Find elsewhere
๐ŸŒ
DEV Community
dev.to โ€บ pedrotech โ€บ how-to-deploy-a-vite-react-app-to-github-pages-4j3k
How to Deploy a Vite + React App to GitHub Pages - DEV Community
December 13, 2024 - Install gh-pages From your project directory, run: ... { "name": "my-vite-react-app", "homepage": "https://<your-username>.github.io/<repo-name>/", "scripts": { "dev": "vite", "build": "vite build", "predeploy": "npm run build", "deploy": "gh-pages -d dist" } }
๐ŸŒ
Medium
medium.com โ€บ @aishwaryaparab1 โ€บ deploying-vite-deploying-vite-app-to-github-pages-166fff40ffd3
Deploying Vite Deploying Vite App to GitHub Pages | by Aishwarya Parab | Medium
July 12, 2023 - import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], base: "/book-landing-page/" }) Install gh-pages package as a dev dependency.
๐ŸŒ
Reddit
reddit.com โ€บ r/reactjs โ€บ deploying first vite project on github pages
r/reactjs on Reddit: Deploying First Vite Project on GitHub Pages
June 12, 2024 -

Hello, I'm creating a simple Note Recorder app with Vite. As many people suggest, I'm trying to track my project with Git and Github. My repository is working fine and I learned how to push recent changes.

However, when I build and deploy my project for "gh-pages", a new branch is created which only contains a "dist" folder.

Is it a good practice to have a "main" branch for inspecting my code as it is originally structured and a "gh-pages" (or whatever name) branch for deploying it?

The purpose of all this is having a portfolio on my resume so recruiters can take a look. This project is simple and uses Local Storage. I want to add more projects in the future using other tools such as Nextjs and a Mongo or Postgres database.

๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ deploying-react-vite-application-mangesh-ahire-p6auf
Deploying a React + Vite application
February 17, 2024 - First, install gh-pages as a dev dependency: ... Finally, go to your GitHub repository's settings page, scroll down to the GitHub Pages section, and configure it to use the gh-pages branch as the source for your GitHub Pages site.
๐ŸŒ
Medium
medium.com โ€บ @arshak.code โ€บ how-to-deploy-a-vite-react-app-with-github-pages-26c7436b57e0
How to deploy a Vite React app with GitHub Pages | by Arshak Grigoryan | Medium
December 25, 2023 - "homepage": "https://<GITHUB_USERNAME>.github.io/<REPOSITORY_NAME>", "scripts": { "gh-pages-build": "vite build", "gh-pages-deploy": "gh-pages -d dist" // other scripts... } import { defineConfig } from 'vite' export default defineConfig({ base: "<REPOSITORY_NAME>", // other configs }) ... If you are using client-side-routing, you may need additional configuration. If you are using React Router you need to use HashRouter instead of BrowserRouter
๐ŸŒ
YouTube
youtube.com โ€บ pedrotech
How To Deploy A React Vite App To Github Pages (Simple) - YouTube
In this video I will teach you guys how to deploy a vite react app to github pages in order to see your projects live.Shoutout to the template I used: https:...
Published: November 21, 2024
Views: 6K
๐ŸŒ
DevGenius
blog.devgenius.io โ€บ how-to-deploy-your-vite-react-app-to-github-pages-with-and-without-react-router-b060d912b10e
How to Deploy Your Vite React App to GitHub Pages (With and Without React Router) | by Fitrahtur Rahman | Dev Genius
November 8, 2023 - This means when we are running npm run dev, the page will start serving on path http://localhost:5173/ instead of http://localhost:5173/react-vite-gh-pages/ On our GitHub repository, navigate to โ€œPagesโ€ menu inside โ€œSettingsโ€ tab.
๐ŸŒ
Medium
medium.com โ€บ @diego.coder โ€บ deploy-your-reactjs-vite-application-on-github-pages-9e433679682a
Deploy Your ReactJS + Vite Project to GitHub Pages Like a Pro! ๐Ÿš€ | by Code & Chill | Medium
February 13, 2025 - In the context of a Vite configuration file, the base option refers to the base path of your application when served in a production environment. This option is part of the build configuration of Vite. ... import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], base: 'https://dcortesnet.github.io/Reactjs-deploy-githubpages', // Link page })
๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ deploying-your-vite-react-project-github-pages-free-bottos-vananti-t2ppf
๐Ÿš€ Deploying Your Vite React Project on GitHub Pages for Free ๐ŸŒ
November 3, 2023 - 4๏ธโƒฃ Open a terminal window in your editor and create a Vite app using this code (I chose React + JavaScript): npm create vite . 5๏ธโƒฃ Install all the dependencies by typing: npm install ยท 6๏ธโƒฃ Ensure your application is working properly ...
Top answer
1 of 8
13

Ok, so to solve this the only thing that I had to do was to add base:"{repName}" to the vite.config.ts file.

Source: https://vitejs.dev/guide/static-deploy.html

The images were not loading, I used this to fix them: Github pages vite JS build not showing the images

2 of 8
13

I see that you have managed to deploy your React project to Github pages successfully, but here is how I did it in case anyone needs help:

  • First things first, make sure that your ".git" folder and your project are in the same folder.

  1. Run npm run build. You should have a dist folder now.
  2. Open the file vite.config.js (or .ts).
  3. Add the base file with your repository name. Include the two /.

Example: let's say your github project's URL is https://github.com/atlassian/react-beautiful-dnd.

export default defineConfig({
  base: "/react-beautiful-dnd/",
  plugins: [react()],
});
  1. Open your .gitignore file and delete the dist line from it. You want to make sure that the dist folder is pushed to github.
  2. git add .
  3. git commit -m "deploy"
  4. git subtree push --prefix dist origin gh-pages
  5. Wait for a couple minutes (in my case it took 4 minutes) and open the page. In the example above, the URL would look like this: https://atlassian.github.io/react-beautiful-dnd

In case it's still showing a blank page, it's very likely to do with the step number 3. Ensure you added the correct repository URL and that it begins and ends with the / sign.

That is about it, I hope it helps. I used this blog post for guidance, it is a more detailed explanation of the above.

๐ŸŒ
Anushnandyala
anushnandyala.github.io โ€บ react-vite-github-pages-guide
Deploy React + Vite App to GitHub Pages | A step-by-step guide to setup and deploy a React + Vite web application to GitHub Pages.
React is a popular JavaScript library used to build interactive user interfaces, enabling developers to create reusable components for dynamic web applications. GitHub Pages is a free and easy-to-use hosting service that allows developers to deploy static websites directly from a GitHub repository, making it ideal for portfolios, projects, and web experiments. This guide will walk through the process of deploying a React + Vite web application to GitHub Pages.
๐ŸŒ
DEV Community
dev.to โ€บ shrinivasv73 โ€บ how-to-deploy-reactjs-apps-built-using-vite-on-github-pages-38bi
How to deploy ReactJS Apps (built using Vite) on GitHub Pages? - DEV Community
December 26, 2025 - This field is particularly important when deploying a React application to GitHub Pages or any other static site hosting service that serves the site from a subdirectory. Do update the values of <username> and <repository> of the homepage property. In my case the values are ShrinivasV73 and Deploy-ReactJS-App-With-Vite respectively.