How to Deploy Your Vite App to Github Pages

  Рет қаралды 70,109

LearnVue

LearnVue

Күн бұрын

Пікірлер: 185
@sebastianteaca7794
@sebastianteaca7794 Жыл бұрын
Wow, this is probably one of the best tutorials I have ever watched on youtube. 10/10. Literally 100% to the point, easy, coherent, adheres to best practices and explains everything. I don't usually comment on videos, but this tutorial really impressed me.
@kevincarter1645
@kevincarter1645 Жыл бұрын
To recommit new changes and push up to the remote repository: 1. On remote repository delete the "gh-pages" branch. 2. In you local repository run this command: npm run build (1:56) 3. git add dist -f (2:05) 4. git commit -m [your commit message here] (2:17) 5. git subtree push --prefix dist origin gh-pages (2:20) if anyone has a quicker process please feel free to update this! but I found this the fastest way to push up to gh-pages.
@chriskim8566
@chriskim8566 Жыл бұрын
Hey! I didn't have to delete my "gh-pages" branch. I just pushed up my new dist file. Github made the changes live within a few minutes.
@filipradinovic9309
@filipradinovic9309 Жыл бұрын
@@chriskim8566 For me it says 'rejected' (non-fast-forward) when I run git subtree push --prefix dist origin gh-pages the second time. Any tips?
@Joshbo5H
@Joshbo5H Жыл бұрын
@@filipradinovic9309 I had this problem when going between devices and making changes. I had to delete my gh-pages branch then it worked.
@Joshbo5H
@Joshbo5H Жыл бұрын
Does your master branch contain the dist folder? I either added mine then pushed to master by accident or it does it automatically.
@annieleonhart-f3x
@annieleonhart-f3x Жыл бұрын
thank you, kind man, I'm a beginner and your comment helped me out
@vuchke
@vuchke Жыл бұрын
1 like is not enough for this.... spent 1 hour googling, then came here and did it in 2 mins hats off my good man
@LearnVue
@LearnVue Жыл бұрын
glad it still works! haha
@vuchke
@vuchke Жыл бұрын
@@LearnVue ❤
@jordan_w
@jordan_w 2 жыл бұрын
Finally someone who explains the meaning behind the steps! Managed to get my Threejs project deployed finally, thank you! :D
@LearnVue
@LearnVue 2 жыл бұрын
Glad it helped!
@zerolelouch22
@zerolelouch22 2 жыл бұрын
Did you follow fireship-io's tutorial for threejs?
@jordan_w
@jordan_w 2 жыл бұрын
@@zerolelouch22 yes!
@zerolelouch22
@zerolelouch22 2 жыл бұрын
@@jordan_w haha nice same here!
@keakash7906
@keakash7906 11 ай бұрын
After almost 3 years also, your tutorial is working perfectly and awesome. Thankyou.
@ksmith4135
@ksmith4135 Жыл бұрын
I'm not even using Vue in my Vite project but after an entire day of trying to get my pages site to work this was what finally did it. simple, clear explanation that doesn't omit necessary details but also doesn't waste time. you're a hero dude.
@L0Ls0ul
@L0Ls0ul 6 ай бұрын
That's one of the best tutorials I've ever watched. I didn't expect to get everything I need in just 4 minutes!
@molnarcsaba2158
@molnarcsaba2158 Жыл бұрын
Man, you are a legend! I struggled to deploy my page on GitHub for two days, following numerous tutorials and forums, but only this method worked for me. Thank you !
@Maracunator
@Maracunator 2 ай бұрын
I just published my first PWA on GitHub thanks to you!
@נועהניסים-נ8ה
@נועהניסים-נ8ה 2 жыл бұрын
You saved me after hours of trying to upload my project to github! Thank you!
@LearnVue
@LearnVue 2 жыл бұрын
glad i could help!
@Frater-Binyamin
@Frater-Binyamin 2 жыл бұрын
me too!
@YogeshYadav-sj4yu
@YogeshYadav-sj4yu Жыл бұрын
Thanks a lot , After numerous failed attempts , this video helped me to deploy my applications .
@aakash8649
@aakash8649 Жыл бұрын
DUDE YOU ARE A GOD, i absolutely hate how confusing it is to update vite codes. thank you
@weler2491
@weler2491 2 жыл бұрын
The first tutorial that accually worked for me. Thanks a lot :)
@dennyfedyna9707
@dennyfedyna9707 Жыл бұрын
3 minutes ONLY enough to deploy the app, thank you!
@mlucas5354
@mlucas5354 9 ай бұрын
Super quick and to the point. Love it! Got it working right away, thanks a bunch
@AgustinNazer
@AgustinNazer 2 жыл бұрын
maaan you saved me, after hours of trying to upload my project, i was looking exactly this, thanks!
@haizu.kun1
@haizu.kun1 11 ай бұрын
For those who wants to deploy to gh-pages with your own custom domain, at 1:41, omit the "base: ..." line altogether. I spent 2 hours debugging why my website 404, that is the cause. Hope this helps!
@guiguitoLemon
@guiguitoLemon 2 жыл бұрын
hands down the best explanation/method by far
@anselmosantos4955
@anselmosantos4955 2 жыл бұрын
Beast, your explanation was without a doubt the best of the tutorials here on youtube. Thank you very much!
@depres1on481
@depres1on481 Жыл бұрын
wow, thank you so much! i have been struggling to make it work but finally i did it because of your video!
@muratkarakaya656
@muratkarakaya656 Жыл бұрын
I will live 2 hours longer thanks to this chanell
@naqieuddinazman4677
@naqieuddinazman4677 Жыл бұрын
Thank you very much !!! Finally I can deploy on GitHub pages after 2 days trying to solve this issue 😭😭
@Lily-um8pl
@Lily-um8pl 2 жыл бұрын
Thank you It's my first time to use router and deploy to github, thank you I love you
@mr-pr0cesss
@mr-pr0cesss Ай бұрын
Thanks a lot for explaining it instead of just showing the commands
@CrazyDiamond24
@CrazyDiamond24 Жыл бұрын
I'm getting this error for some reason..any insight? Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../"
@Turist_Turist_
@Turist_Turist_ Жыл бұрын
Thank you. i had hard time to understand what i did wrong, your tutorial really help me out
@MichaelEvans-le8zr
@MichaelEvans-le8zr 2 жыл бұрын
Thanks for all the help! Do I need to `git add dist -f `, `git commit` , and `git subtree push --prefix dist origin gh-pages` every time? Or is there a quicker way to push?
@zackplauche
@zackplauche 2 жыл бұрын
Hey @LearnVue please reply to this one ^ Tell us how to do it everytime lmao.
@MVNHD
@MVNHD Жыл бұрын
@@zackplauche did you figure it out?
@granmini
@granmini 2 жыл бұрын
Thank you very much! And then I was tormented with the publication on git-hub pages. I've never had this problem with vue-cli before. Vite is cool, but there are still some points that are worth learning.
@learnerforlife1338
@learnerforlife1338 2 жыл бұрын
A question, now if we make changes in origin/master repo ,do they reflect on our site or we have to again build a Dist and match it with gh-pages?
@StephanieDawson85
@StephanieDawson85 Жыл бұрын
any answer? wondering the same thing.
@MVNHD
@MVNHD Жыл бұрын
@@StephanieDawson85 same here, any luck?
@ashuzon
@ashuzon Жыл бұрын
I tried the same, and it does not work together. One need to push the chnages I guess. However, my approach might be solely wrong.
@Alexony21
@Alexony21 Жыл бұрын
Buddy you are a life saver thanks alot for this amazing step by step tutorial
@anatoliitytarenko4926
@anatoliitytarenko4926 2 жыл бұрын
Awesome it's exactly what I found. Ty a lot man, very understandable and short as it needed
@olegbukovskiy7484
@olegbukovskiy7484 Жыл бұрын
Дякую, мені це дуже допомогло :))
@Gadrawingz
@Gadrawingz 2 жыл бұрын
Precise! My app is successfully deployed!
@_Enj0y_
@_Enj0y_ Жыл бұрын
Thanks, Man, :) finally, it worked. you save my day.
@sunjin222
@sunjin222 Жыл бұрын
This is literally what i wanted thanks this was very helpful
@sen1817
@sen1817 8 ай бұрын
IT WORKED! THANK YOU SO MUCH!
@vahesevachyan9399
@vahesevachyan9399 10 ай бұрын
Worked beautifully, thank you!
@丅-u2h
@丅-u2h 2 жыл бұрын
Thanks you so much ! -btw if u have some errors! just create an another folder en copy/paste content file in the new one then retry this tuto )
@PrattsYT
@PrattsYT 11 ай бұрын
Simplest Tutorial That best Explaination !!!!!
@cjay-dcode
@cjay-dcode 3 жыл бұрын
Thanks a lot. This solved my issue of page not found after reloading.
@kadircanyazc2460
@kadircanyazc2460 Жыл бұрын
I have a multi-page static website setup, but when i host it on GH Pages, the only page that actually gets pre-pended '/repo-name/' is index.html, when i click a link to another page, i get a 404 error because the links do not incluse the repository name on the path. How do i fix this?
@sguitas
@sguitas Жыл бұрын
Me too. Any solutions? I did exactly as the video said, many times, but it just display an error 404 page.
@DanBowles
@DanBowles Ай бұрын
You saved me from writing yaml. Bless you 😅
@rithikguleria8278
@rithikguleria8278 Жыл бұрын
Tried everthing yesterday night but nothing worked thankyou so muchh for this❤️❤️
@adityapathak300
@adityapathak300 2 жыл бұрын
please help me how to get the vite.config.js file
@arthurq7843
@arthurq7843 9 ай бұрын
Great vid!!! Helped a lot THANKS!!!!
@janhorak5363
@janhorak5363 Жыл бұрын
I have a problem, that when i push to my main repo, the created dist folder is pushed also, as it was forcefully added. How do i prevent this?
@enoligareta3278
@enoligareta3278 2 жыл бұрын
Perfect! Thank you very much!
@ukyawminthein2578
@ukyawminthein2578 11 ай бұрын
Thanks for your sharing and it is very useful to me for upload to github.
@ryandaepic1838
@ryandaepic1838 2 жыл бұрын
How do it push to main branch? If I do git push origin main it still pushes the dist folder as well
@mariia-travels
@mariia-travels Жыл бұрын
Thank you so much for this tutorial!
@shivanshsharma7422
@shivanshsharma7422 2 жыл бұрын
Thank you so much this really helped me out bro.
@LearnVue
@LearnVue 2 жыл бұрын
No problem 👍
@ahmedallawi8638
@ahmedallawi8638 Жыл бұрын
Thank you very much, but there is still a problem, which is that when I am not on the home page and reload, a 404 error appears
@iligol3
@iligol3 2 жыл бұрын
Thank you very much, very quick and helpful!
@SowmyaNaik-u5y
@SowmyaNaik-u5y Жыл бұрын
Can you create a video for organisation level repositories. This seems to be working perfectly fine for personal repo, but shows 404 error on org repo.
@mrchedda
@mrchedda Жыл бұрын
Thanks so much for this video. It really helped me solve the problem of pushing staged items to a separate branch. But now I'm experiencing a couple things. 1. my dist folder is not getting added to staged area anymore. 2. How do you push updates to the gh-pages subtree now? Thanks in advance for any help from you or anyone!
@vanhelsingx69x
@vanhelsingx69x 10 ай бұрын
@mrchedda did you find a sollution for updating gh-pages?
@mrchedda
@mrchedda 10 ай бұрын
@@vanhelsingx69x this comment is one newborn old, I forget if I solved it or not 🙁
@hymerrathebarbarian
@hymerrathebarbarian 10 ай бұрын
npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@efemenaekagha3406
@efemenaekagha3406 2 жыл бұрын
Wow every step worked, thanks alot.
@arnabsaha8436
@arnabsaha8436 2 жыл бұрын
Thanks a lot. For explaning step by step.
@dhaniprolink611
@dhaniprolink611 2 жыл бұрын
hey, thanks for the tutorial, it works, but mine, all of the images are gone undetected... maybe because it's placement has been changed... how do i fix it?
@alexbcn77
@alexbcn77 Жыл бұрын
Amazing video! If it's a Vue3 ts project do I need to add a vue.config.js file? Thank you!
@ickass
@ickass Жыл бұрын
super helpful! thank you!
@velkanalpha
@velkanalpha 2 жыл бұрын
Thanks man... perfect explained.
@moisesn
@moisesn Жыл бұрын
excellent tutorial! Thanks!
@АйдынГалымжанулы
@АйдынГалымжанулы 10 ай бұрын
Bro, i have broblem when i update the page i have error 404, how can i solve this in vue app?
@eugeniakapusta4902
@eugeniakapusta4902 Жыл бұрын
after git subtree push --prefix dist origin gh-pages, I have mistake: git: 'subtree' is not a git command. See 'git --help'.
@VijayCse-k6i
@VijayCse-k6i Жыл бұрын
Sir addFolder in dist folder this folder media only datas how to config.js
@Isythos
@Isythos Жыл бұрын
So I have a question. Does this mean if I commit to the master branch in the future the dist folder will automatically be commited to the gh_pages branch separately?
@ilordepic
@ilordepic Жыл бұрын
thanks man it was a huge help
@ianshaw6085
@ianshaw6085 2 жыл бұрын
Hey great video. What is the best way to push further changes to the gh-pages branch?
@ianshaw6085
@ianshaw6085 2 жыл бұрын
I was having issue updating the subtree and in the end deleted it on github and then re-pushed. This isn't obviously the correct way but it works. Any pointers how to update the subtree properly?
@indiekidney3890
@indiekidney3890 2 жыл бұрын
you just have to redeploy it if you want to update the site: npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@anthonyngooo
@anthonyngooo 2 жыл бұрын
@@indiekidney3890 been trying this and run into errors: error: failed to push some refs to 'url', hint: updates were rejected because a pushed branch tip is behind its remote. using a different branch resolved the issue, but like OP said doesn't seem to be the correct way
@thehero9
@thehero9 2 жыл бұрын
@@anthonyngooo hey bro have you found a way to fix the "behind its remote"?
@anthonyngooo
@anthonyngooo 2 жыл бұрын
@@thehero9 so I did what the OP did, except I re-pushed onto a new branch instead of deleting the gh-pages branch and pushing again to a “new” gh-pages branch Hope that makes sense
@vanhelsingx69x
@vanhelsingx69x 10 ай бұрын
How to update it? Like I deployed it yesterday on gh-pages. Today I have a new update.. how can I see the update in gh-pages?
@hymerrathebarbarian
@hymerrathebarbarian 10 ай бұрын
npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@andilemasela2719
@andilemasela2719 2 жыл бұрын
Hi, How would I deploy the repo if it is an organization private repo?
@thebunsenburner
@thebunsenburner Жыл бұрын
Trying to get this to run on a custom domain is such a pain. Really wish there were better directions available online for this. :'(
@phantomx3710
@phantomx3710 Жыл бұрын
How can i update my gh-pages if i make changes to the main branch?
@vanhelsingx69x
@vanhelsingx69x 10 ай бұрын
@phantomx3710 Did you find a sollution?
@hymerrathebarbarian
@hymerrathebarbarian 10 ай бұрын
npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@liubuntu
@liubuntu 3 жыл бұрын
Thank you a lot! That was extremely helpful.
@synglrty
@synglrty Жыл бұрын
help me pls, after visiting my site i have empty page and 0 errors ,wtf is this?
@stratocaster1134
@stratocaster1134 Жыл бұрын
This was a perfect video, thankyou! One question. How do I update the gh-pages when I have added more code to my project?
@vanhelsingx69x
@vanhelsingx69x 10 ай бұрын
@stratocaster did you find a solution?
@hymerrathebarbarian
@hymerrathebarbarian 10 ай бұрын
npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@tatsumii1420
@tatsumii1420 Жыл бұрын
does this method work with react also?
@ИльяСкладник
@ИльяСкладник Жыл бұрын
Cool! Thank you!
@ArmandoPineda4
@ArmandoPineda4 Жыл бұрын
You're awesome! Muchas gracias.
@adimac9346
@adimac9346 3 жыл бұрын
Clear and fast!
@zerolelouch22
@zerolelouch22 2 жыл бұрын
Does anyone else get error "loading module from (name of repo) was blocked because of a disallowed MIME type (“text/html”)"? It seems to block my index.html from linking the js files.
@dodsamwan4099
@dodsamwan4099 2 жыл бұрын
Hey, how did you solve this?
@edgardevelops
@edgardevelops 2 жыл бұрын
@@dodsamwan4099 you might have missed the base: part of the video on vite.config.js
@mephistolezz
@mephistolezz Жыл бұрын
@@edgardevelops I also have this error and I did put in the base?
@edgardevelops
@edgardevelops Жыл бұрын
@@mephistolezz if you are using the main repository, you have to make the root your base, if you are using other repository then you have to update the base repository depending on the url of the repo, if that make sense.
@joemalone8685
@joemalone8685 2 жыл бұрын
Awesome. Just awesome.
@AgustinNazer
@AgustinNazer 2 жыл бұрын
Its the same with react ?
@yogyyconst
@yogyyconst Жыл бұрын
big help, thanks.
@MP-xz7om
@MP-xz7om 9 ай бұрын
it worked to host it, but my google popup signin is blocked when i try to login
@MP-xz7om
@MP-xz7om 9 ай бұрын
fixed it, had to add the github domain in firebase in authentication
@codeAbinash
@codeAbinash 2 жыл бұрын
Thanks a lot 💖💖💖💖
@thangtrieu1499
@thangtrieu1499 2 жыл бұрын
excellent ,thank you very much !
@Pages_Perfected
@Pages_Perfected Жыл бұрын
Very helpful vid Thanks
@kaungmyat4438
@kaungmyat4438 Жыл бұрын
thanks sir, it's help me alot
@dragon3602010
@dragon3602010 3 жыл бұрын
awesome thanks, is it possible to make videos about Nuxtjs with Vite to make static websites, thanks in advance
@LearnVue
@LearnVue 3 жыл бұрын
okay! would you be looking more for beginner level “how nuxtjs works and how to get setup” or more intermediate/advanced guides?
@dragon3602010
@dragon3602010 3 жыл бұрын
@@LearnVue for more intermediate level if it's possible 😊, thanks
@estefonokaleidos3355
@estefonokaleidos3355 Жыл бұрын
Man, i love u!!!
@zackplauche
@zackplauche 2 жыл бұрын
BE WARNED: OP only shows how to deploy it once, not more than once.
@thuannguyenvo5831
@thuannguyenvo5831 3 жыл бұрын
It says: It looks like either your git installation or your git-subtree installation is broken when I run git subtree push --prefix dist origin gh-pages. How should I fix this?
@LearnVue
@LearnVue 3 жыл бұрын
what's the error you're getting?
@mike110111
@mike110111 3 жыл бұрын
@@LearnVue I'm getting this hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes hint: (e.g. 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
@mike110111
@mike110111 3 жыл бұрын
I think it's because I used a custom domain name and github pages put a CNAME file into the gh-pages branch
@mike110111
@mike110111 3 жыл бұрын
No idea what to do now. Everything I do breaks for some reason
@mike110111
@mike110111 3 жыл бұрын
this seems to have fixed it: put this into vite.config.js export default { build: { emptyOutputDir: false } } (makes sure you don't clear the output folder on build)
@victorpazb
@victorpazb 4 ай бұрын
Gained another subscriber!
@Frusticks
@Frusticks 2 жыл бұрын
What should I do if I want to update the page? the git subtree push command is being rejected because there's already a branch with that name. Do I delete it and repush?
@KevinHernandez-wm9gj
@KevinHernandez-wm9gj 2 жыл бұрын
I got the same error, so. I deleted the branch and enviroment in github and push again the subtree command and it works
@hymerrathebarbarian
@hymerrathebarbarian 10 ай бұрын
npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@eliabenascimentosilva8400
@eliabenascimentosilva8400 2 жыл бұрын
Can you teach how to deploy vite into heroku?
@Gabriel-yl8cb
@Gabriel-yl8cb 3 жыл бұрын
Thank you ❤️
@LearnVue
@LearnVue 3 жыл бұрын
You’re welcome 😌
@psybitcoin
@psybitcoin 3 жыл бұрын
How to redeploy?
@weirddev
@weirddev 2 жыл бұрын
npm run build git add dist -f git commit -m "..." git subtree push --prefix dist origin gh-pages
@ryandaepic1838
@ryandaepic1838 2 жыл бұрын
@@weirddev But when you do the normal `git push origin -u main` after, it pushes the dist folder as well to the main branch remotely. Is there a fix for this or work-around?
@shoebmerchant9797
@shoebmerchant9797 2 жыл бұрын
@@ryandaepic1838 Just undo the commit and remove the files from staging
@_regman
@_regman Жыл бұрын
@@shoebmerchant9797
@juancaycho6711
@juancaycho6711 2 жыл бұрын
Gracias, me sirvió bastante
@gigatoxishvili9991
@gigatoxishvili9991 Жыл бұрын
omg bruh I cant thank you enough
@webtech460
@webtech460 2 жыл бұрын
Cool.. Thank You.
How To Deploy A React Vite App To Github Pages (Simple)
7:39
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Используем GitHub Actions для публикации на GitHub Pages
13:39
Михаил Непомнящий
Рет қаралды 6 М.
Deploy Your React App on GitHub Pages in 5 Minutes!
6:39
Code With Yousaf
Рет қаралды 11 М.
This is How I Scrape 99% of Sites
18:27
John Watson Rooney
Рет қаралды 207 М.
How To Deploy A React App To Github Pages (Simple)
10:00
PedroTech
Рет қаралды 251 М.
How I deploy serverless containers for free
6:33
Beyond Fireship
Рет қаралды 578 М.
Why I Love Vue's Newest Feature
3:49
LearnVue
Рет қаралды 14 М.
Deploy Vite app on Github pages using Github Actions
11:40
benixal
Рет қаралды 11 М.
How to Deploy React App to GitHub Pages | Step by step.
5:44
Code With Ajesh
Рет қаралды 260 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН