GitHub
github.com › sitek94 › vite-deploy-demo
GitHub - sitek94/vite-deploy-demo: Deploy Vite app to GitHub Pages using GitHub Actions · GitHub
import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + base: '/vite-deploy-demo/' }) Now, asset links will have a correct path, so commit ...
Starred by 383 users
Forked by 54 users
Languages JavaScript 52.8% | CSS 34.4% | HTML 12.8%
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
Starred by 356 users
Forked by 67 users
Languages CSS 51.2% | TypeScript 38.3% | HTML 10.5%
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
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
reactjs - How to deploying Vite react app on Github - Stack Overflow
I encountered following error while trying to deploy my React + Vite app on Github. Error: ENOENT: no such file or directory, stat 'C:\Users\mypc\Documents\javascript\newsApp\build' Please help me ... More on stackoverflow.com
Problems with hosting react/vite project on github pages with a custom domain
Have you tried one of these guides? https://vitejs.dev/guide/static-deploy.html https://github.com/sitek94/vite-deploy-demo More on reddit.com
DEV Community
dev.to › badr21 › create-a-react-app-with-vite-and-deploy-it-on-github-224n
Create a React app with Vite and deploy it on GitHub - DEV Community
March 26, 2023 - This will stage all the files in your project for committing. ... This will create a new commit in the Git repository with the message “Initial commit”. 4- Rename the master branch to main by running the command: ... This will add the GitHub repository as a remote for your local Git repository. 6- Finally, push the changes to the remote repository by running the command: ... This will push the initial commit of your local Git repository to the GitHub repository. With the React app pushed to Github, you can now deploy your React app.
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 - This will stage all the files in your project for committing. ... This will create a new commit in the Git repository with the message “Initial commit”. 4. Rename the master branch to main by running the command: ... This will add the GitHub repository as a remote for your local Git repository. 6. Finally, push the changes to the remote repository by running the command: ... This will push the initial commit of your local Git repository to the GitHub repository. With the React app pushed to Github, you can now deploy your React app.
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.
Top answer 1 of 3
4
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.
2 of 3
1
I did the same. But for some reason, none of the gifs and images that I had in my pre-build are no longer being displayed. What's wrong? Can anyone help me with this? I am also facing another issue, my website is a multi-page vite+react app. When I get onto the webapp homepage using the direct url, everything is alright, I am able to navigate to the other sub-pages of the website as well, but if I directly type the url with the path to the subpage in the url itself, the website shows 404 error. What is wrong and how to handle this? I don't know if I am making sense above. Please help me out.
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 - After running this command, git pushes the contents of the dist directory (which contains the built assets) to the gh-pages branch of your repository. This branch serves as the source for your GitHub Pages website. GitHub automatically detects changes to this branch and updates your website accordingly. Once the deployment process is complete, your website is live! You can access it using the URL : ... Congratulations! Your Vite React website is now successfully deployed to GitHub Pages, and it’s ready to be accessed by users around the world.
Reddit
reddit.com › r/react › 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?
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? : r/react
February 20, 2023 - I used Github for my personal site for several years but recently switched to Netlify, I highly recommend. Their CI/CD is a lot more intuitive than Github actions too. Just push and your app/site will build and publish automatically. I built a motion editor with React + Gsap ( beta is now open )
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
GitHub
github.com › ErickKS › vite-react-router
GitHub - ErickKS/vite-react-router: Guide for vite react app with router deploy · GitHub
git init git add . git commit -m "add: initial files" git branch -M main git remote add origin https://github.com/[USER]/[REPO_NAME] git push -u origin main · Config -> Actions -> General -> Workflow permissions -> Read and Write permissions ...
Starred by 138 users
Forked by 18 users
Languages TypeScript 33.4% | CSS 32.5% | HTML 27.1% | JavaScript 7.0%
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 - Replace <your-username> and <repo-name> with your actual GitHub username and repository name. Configure Vite Base URL In vite.config.js, set the base to match your repo’s path: import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' export default defineConfig({ base: '/<repo-name>/', // Add this line plugins: [react()] }) ... This command builds your app and pushes the dist folder to the gh-pages branch of your repo.
Selftaughttxg
selftaughttxg.com › 2023 › 03-23 › create-a-react-project-push-it-to-github-and-deploy-with-netlify-from-the-command-line
Create a React Project, Push It to GitHub, and Deploy With Netlify, From the Command Line |
March 20, 2023 - First, we need to initiate your project as a GitHub repository. ... Leave the default as origin. ... Now it's time to commit our changes and push our repo up to GitHub. We can add all of our changes with one command as follows: ... warning: in the working copy of 'vite-project/.gitignore', ...
Stack Overflow
stackoverflow.com › questions › 77933390 › how-to-deploying-vite-react-app-on-github
reactjs - How to deploying Vite react app on Github - Stack Overflow
I encountered following error while trying to deploy my React + Vite app on Github. Error: ENOENT: no such file or directory, stat 'C:\Users\mypc\Documents\javascript\newsApp\build' Please help me ...