How To Deploy A React App To Github Pages (Simple)

Поділитися
Вставка

КОМЕНТАРІ • 410

  • @linaspliki6589
    @linaspliki6589 5 місяців тому +77

    Heads up to anyone using Vite instead of create-react-app. Vite creates a "dist" folder instead of "deploy" on build so you need to add "deploy": "gh-pages -d dist" instead of "deploy": "gh-pages -d deploy" when adding to scripts. If you don't do this Vite won't locate the "build" folder and the gh-pages branch will not get created.

    • @vanodee9757
      @vanodee9757 4 місяці тому +5

      You're an amazing person. thank you for this. Been struggling for an entire afternoon.

    • @Code.J
      @Code.J 4 місяці тому

      Thank you very much! :D

    • @iberry2689
      @iberry2689 3 місяці тому

      THANK YOU SO MUCH 😭

    • @arkansavalder
      @arkansavalder 2 місяці тому +1

      🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵🥵

    • @kasho_ali
      @kasho_ali 2 місяці тому

      Thank you so much 😭😭😭❤️

  • @artisticdevelopment7181
    @artisticdevelopment7181 Рік тому +97

    As a self-taught developer it warms my heart to find someone that explains things so well. Thank you thank you thank you.

    • @hopevandyne3258
      @hopevandyne3258 11 місяців тому

      I AGREE!!! Tutorials r usually people giving the steps without any explanation as to why we’re doing it.

  • @AlamMahmood
    @AlamMahmood Рік тому +3

    Man you saved my life. I created an application on React but was having hard time to deploy to github pages..u helped

  • @sora_dev
    @sora_dev 2 роки тому +3

    I read docs, digged stack overflow, etc for 3 hours plus to get by website up, ended up watching your video and voila! Thanks a lot chief, subbed!

  • @juan83xd
    @juan83xd Рік тому

    Thank you! I have been trying to deploy my app for hours. Your tutorial was the only one that worked for me. Thank you.

  • @jasimrazamomin3117
    @jasimrazamomin3117 2 місяці тому +1

    I rarely leave any comments on any video but this worked perfectly for deploying my portfolio. Thank you so much! It took me hours and hours of googling and installing stuff and doing complex things that didn't work but this worked on its first go. Once again thank you for making such a great and straightforward video!

  • @dailyvictoryy8633
    @dailyvictoryy8633 2 роки тому +1

    Loved the video Pedro. The way you teach, I can tell that you fully understand the things that you teach because of how simple you explain it. Even a 7 year old would be able to understand.

  • @Hacking-NASSA-with-HTML
    @Hacking-NASSA-with-HTML Рік тому +2

    Thank you, sir, So Much👍! You are my Hero! So simple and easy in ten minutes to deploy an app with your guidance!
    I have my first react app deployed to gh-pages🤝 it works ✅

  • @zzzzzzzzzz3567
    @zzzzzzzzzz3567 Рік тому

    You are amazing. The way you explain is so clear and easy to follow. Thank you so much!

  • @ummi7292
    @ummi7292 5 місяців тому

    I was so lost, confused, distraught because i was facing a roadblock with this deplyment part ...UNTIL i found this !! cant thank you enoough ! May you be blessed!

  • @DungLearnThings
    @DungLearnThings Рік тому

    I love you man :)) not only did you show us how to deploy but also explain some "aside" things and i like that

  • @p.rusinov8732
    @p.rusinov8732 Рік тому

    Thanks a lot! Best react course i've seen on youtube keep going!

  • @aabhasjain96
    @aabhasjain96 2 роки тому +2

    Thanks Pedro for everything, I am loving your content. From last one week I have started watching your videos and there isn't a single day when I haven't watch your video. Thanks once again ❤❤

  • @anselmpeter
    @anselmpeter Рік тому

    Today I deployed my site after the efforts and learning of many days. Thanks to PedroTech for this awesome very straightforward video to help me through the way.

  • @gcsandesh
    @gcsandesh 2 роки тому +11

    I searched for this problem everywhere, finally this video helped me solve the problem of deploying the react app. When I deployed the app I would get a blank page on the github page. But I followed your steps and it worked. The key is to
    1. "put the scripts in order" and
    2. "put the homepage url correctly".

    • @liliyao317
      @liliyao317 Рік тому +3

      I faced the same problem, and after following this tutorial, I still got a blank page... 🤣

    • @keldrogo175
      @keldrogo175 Рік тому

      @@liliyao317 did you find a solution to that ?

    • @dylaneamos
      @dylaneamos Рік тому

      @@liliyao317 Same man. I AM STILL GETTING A BLANK PAGE AND I DO NOT KNOW WHY and it's irritating hahaa. Incase you found the solution please share.

    • @anon00s
      @anon00s 8 місяців тому

      worked for me ty

    • @bryan.gonzales
      @bryan.gonzales 6 місяців тому

      bro i just did it and i got the same white blank page. been at this the whole day@@dylaneamos

  • @luan_ferreira_
    @luan_ferreira_ 2 роки тому

    Thank you so much my guy, I looked for several videos here from my region Brazil, and none really helped me, yours was the most complete and correct, and by the way, your name "Machado" is the same as an important Brazilian writer Machado de Assis.

  • @febindevassia333
    @febindevassia333 10 місяців тому

    Thank you so much for this bro. I'm an aspiring react developer from KERALA,INDIA. This video helped me a lot to deploy and publish my website properly . Thanks a lot.

  • @MeriThrash
    @MeriThrash 2 роки тому

    Thanks dude! I couldn't find a decent tutorial and this helped a lot. I'm suscribing right now and I'll surely look your other videos. Thanks you soooo much!

  • @codingwithkenny6492
    @codingwithkenny6492 2 роки тому +9

    Thank you so much! I used to struggle so much with the entire process involving using the terminal. This is the best tutorial I've found and it was also very easy to follow along! You just earned a new subscriber 😉

  • @nabilhaouam8497
    @nabilhaouam8497 2 роки тому

    thank you , this helped so much
    I've never used github pages before and this tutorial made it easier

  • @kayraczerniewicz5047
    @kayraczerniewicz5047 8 місяців тому

    Thank you so much! excelent tutorial, been looking for this everywhere!

  • @user-lm2cg8kv3w
    @user-lm2cg8kv3w 9 місяців тому

    thank you so much i was struggling with this for a while ! this is the easiest video to follow!

  • @kalinaszek
    @kalinaszek Рік тому

    helped me done task on deadline, great video, straight to the point

  • @stransey
    @stransey 2 роки тому +1

    Thanks, your tutorial is better than all i found in the internet

  • @marcosmeneghetti3261
    @marcosmeneghetti3261 Рік тому +7

    Obrigado, Pedro, pelo super tutorial. Estou aprendendo bastante contigo.
    Forte abraco.

  • @moonchild_ankita
    @moonchild_ankita Рік тому

    Thank you so much for the video. This helped me a lot. I didn't knew the script order was the issue.

  • @TheJockerproductions
    @TheJockerproductions Рік тому

    Litteraly the best explanation i found so far! thank you so much

  • @chandrashekharbhagat2435
    @chandrashekharbhagat2435 Рік тому

    very clear and smooth explanation , thanks buddy!

  • @liliyao317
    @liliyao317 Рік тому

    Thank you so much! I finally got my pages after so many tries.

  • @vivianeups
    @vivianeups 2 роки тому

    Great, thank you so much! It worked to me to deploy my first react-app!!

  • @j13131
    @j13131 Рік тому

    Thank you! It take me several tutorials to get it done.

  • @Matt_Kumar
    @Matt_Kumar 7 місяців тому

    Thank you for the video, it was easy to follow and I was able to get my page up with ease!

  • @sayyedsameerbasir2593
    @sayyedsameerbasir2593 Рік тому

    Really helpful video, you solved the problem for which i m struggling from last 1 month

  • @asaventurasderobson
    @asaventurasderobson 2 роки тому

    Thank you man, that is an absolutely great tutorial, hard to find these days.

  • @nurdanokcu3906
    @nurdanokcu3906 Рік тому

    Loved it , very easy to understand. Thank you.

  • @malouette3991
    @malouette3991 Рік тому

    Thank you for the clear explanations! It worked perfectly!

  • @user-nj3lg7wi5r
    @user-nj3lg7wi5r 2 роки тому

    I thank you for this tutorial. It helped me a lot to deploy React apps. 10 bows to you.

  • @devstuff92
    @devstuff92 2 роки тому +1

    I love your videos man, I can't thank you enough! Question though, totally new with React here, we don't need to use" npm react build" before deploying our app to a github repository?

  • @vasilemidrigan50
    @vasilemidrigan50 2 роки тому

    Thank you so much, I spent all day and finally did it!

  • @DreBox10
    @DreBox10 2 місяці тому

    First tutorial that actually worked for me, I appreciate it

  • @ajaybisht1658
    @ajaybisht1658 2 роки тому +1

    You made this so easy, thanks a lot

  • @Amsanc
    @Amsanc Рік тому

    Graças a você consegui finalmente publicar o site. Muito obrigado Pedro.

  • @tomjohansson3520
    @tomjohansson3520 Рік тому

    I followed this video and was surprised at the ease to follow along. Now i have a working github page where i can document my progress as i learn to code. i would love to see a follow up on how to add a github action to check if code is working before building

  • @t-uzithehunterxx5879
    @t-uzithehunterxx5879 Рік тому +1

    sabia que tu era br!! muito bom teus videos, o curso de react pra iniciantes me deu uma ajuda absurda. valeu pedro tech, tamo junto

  • @shirouF
    @shirouF 11 місяців тому

    My deployed site showed a blank page, and using HashRouter instead of BrowserRouter in my index.js file fixed the issue. Hope this helps anyone else facing the same thing.
    Thank you for the well put video!

  • @19xalex89
    @19xalex89 Рік тому

    Thank you very much. Your help was invaluable and I cannot thank you enough

  • @DanielMoreno-lc9bx
    @DanielMoreno-lc9bx Рік тому +1

    I really appreciate your help, now I have a question, what if I want to deploy it with a back-end and database? I guess with the back-end is pretty similar, but what for the database? Thank you.

  • @lhomme_flaneur
    @lhomme_flaneur Рік тому

    thank you man! that helped me a lot! keep postin

  • @roelineburger9172
    @roelineburger9172 2 роки тому

    This is amazing!! If I make changes to the repo, do I run the deploy script again for the changes to reflect?

  • @UAV_Musafhir
    @UAV_Musafhir 3 місяці тому

    youre amazing bro. simple steps. Tysm

  • @shubhamaryan6064
    @shubhamaryan6064 Рік тому

    Very well explanied . Thanks a lot dude !!

  • @visheshpandey2001
    @visheshpandey2001 Рік тому +14

    So if anyone wants to know how to keep updating the gh-pages with main branch then you have to simply do one thing :
    update your main branch and commit changes..
    once it is done then .. again run the command in terminal :
    npm run deploy
    now after you will run this command it will update the gh-pages automatically
    Thank you

    • @andresfelipecanobotero8814
      @andresfelipecanobotero8814 Рік тому +2

      When I do 'npm run deploy' I get the following error: 'gh-pages' is not recognized as an internal or external command, operable program or batch file. This is after successfully deploying my site and pushing changes to the main branch. Does anyone know why?
      EDIT: Figured it out, gotta make sure 'gh-pages' is in your dependencies in the package.json file. If not, gotta rerun ''npm install gh-pages' and try 'npm run deploy' again!

    • @visheshpandey2001
      @visheshpandey2001 Рік тому +1

      @@andresfelipecanobotero8814 Oh great! I was about to answer.

    • @felipenegreiros1914
      @felipenegreiros1914 Рік тому +1

      @@visheshpandey2001 I got a different error:
      npm run deploy>
      ENOENT: no such file or directory, stat 'G:\programing\portfolio\portfolio\build'
      PS G:\programing\portfolio\portfolio>

    • @trexon2360
      @trexon2360 Рік тому

      @@felipenegreiros1914 in your package.json file you edited, change
      "deploy": "gh-pages -d build", to "deploy": "gh-pages -d dist"
      when you you run build, it builds into the dist folder and not the build folder

    • @shadowysuper-coder6120
      @shadowysuper-coder6120 6 місяців тому

      @@trexon2360 thank you so much for this reply, I fixed the ENOENT error and now have the Published message at the end ❤❤

  • @user-pk1so3dg2v
    @user-pk1so3dg2v Рік тому

    I spent three hours alone but thanks to this video I solved problem at once
    Thank you very much

  • @PatrikRasch
    @PatrikRasch Рік тому

    Here again after finishing my newest project, thank you again! 😂👏

  • @kritidwivedi7744
    @kritidwivedi7744 Рік тому

    THANKYOUUUUUUUU, HAD BEEN STRUGGLING A LOT FOR THIS

  • @kennethimade4637
    @kennethimade4637 2 роки тому

    thanks for making this video, really helped me out

  • @codingcody
    @codingcody Рік тому

    Very good and detailed explanation. Thank you

  • @vantal4115
    @vantal4115 Рік тому +1

    thank u so much .. i am in love with your teaching

  • @mohammedammarkurabi7520
    @mohammedammarkurabi7520 Рік тому +1

    Many thanks. Excellent tutorial

  • @robertobenedit
    @robertobenedit Рік тому

    Perfect! everything is working just fine!

  • @poeticider
    @poeticider Рік тому

    this helped me out a lot. many thanks!

  • @macskology
    @macskology Рік тому

    Thanks a lot! This was so clear.

  • @mennaelshahawy8207
    @mennaelshahawy8207 5 місяців тому

    Thank you so much 😍 This was really helpful.

  • @samuelsolomon348
    @samuelsolomon348 Рік тому +1

    hey there great tutorial, but i have one question, when i opened link it immediately took me to my "missing" page instead of my "home page", i had to redirect the page to the homepage, is that normal

  • @abdullahm6238
    @abdullahm6238 11 місяців тому

    i have been searching for this for ages

  • @ThColinPereira
    @ThColinPereira 2 роки тому

    Super helpful as always!

  • @jreezy6047
    @jreezy6047 Рік тому

    Thank you so much! Very helpful!

  • @umaimafaisal6396
    @umaimafaisal6396 2 роки тому

    You saved my life, thank you for existing

  • @fotios4902
    @fotios4902 2 роки тому

    Good that you mention that it takes a while after the page is actually visible in the address.

  • @bestakuma11
    @bestakuma11 Рік тому

    I appreciate...i love the part u talked about running "npm deploy" so many times.

  • @Lik4nGaming
    @Lik4nGaming Рік тому

    Hi, first let me say thank you for the guide, it worked perfectly. Now, let's say i changed something in my project, do i need to only push to github or do both push and the run deploy command?

  • @MrBox4soumendu
    @MrBox4soumendu Рік тому

    You are always a boss, following you from long back. ❤

  • @idanlib
    @idanlib Рік тому

    Hey pal, thanks for the video! Does the process necessitate having a new repo, or can I deploy to an existing repo? I have an exiting github pages (based on a repo), and I'd like to deploy to that, as opposed to creating a new repo.

  • @pepsicolla123
    @pepsicolla123 7 місяців тому

    Thank you very much! It worked! 🎉❤

  • @ramb6500
    @ramb6500 2 роки тому +1

    thanks so much very simple and easy language you explain ,search so many videos but this is best one thanks ...

  • @yashraj6565
    @yashraj6565 2 роки тому +2

    After 15 min, my site is still not appearing on given link by the gh pages!...

  • @MeitoShirogane
    @MeitoShirogane 2 місяці тому

    you literally saved my day, thank you so much

  • @MrBill007
    @MrBill007 10 місяців тому

    You've earned yourself a subscriber sir !! you are amazing

  • @grandorf5967
    @grandorf5967 2 роки тому

    Great tutorial! It's just awesome!

  • @davitazariani5009
    @davitazariani5009 8 місяців тому

    Thanks, very useful for beginners👍🏾

  • @ylahti6
    @ylahti6 3 місяці тому

    Thank you! I've been battling this issue for the WHOLE DAY - I'm such a noob D:

  • @noeliacaseres7567
    @noeliacaseres7567 Рік тому

    Thanks so much for this video Pedro! But I have an issue. The gh-pages branch doesn't show in my repository after npm run deploy and refresh the page. Only the main branch. Help!

  • @giffarialfarizy7310
    @giffarialfarizy7310 2 роки тому +1

    Thanks. I really need this kind of videos!

  • @melamelawen
    @melamelawen Рік тому

    thanks a lot man! This helped me a lot

  • @mattholsten7491
    @mattholsten7491 2 роки тому

    Just a perfect video. Thanks homie.

  • @rococococoa
    @rococococoa 2 роки тому +1

    Thanks! I want to get faster and faster at deploying a static react frontend build, so I will try this out (though I wasn’t able to find a related repo linked).

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому +1

      Thank you for the support! I don't remember why I didn't put the link in the description but here it is: github.com/machadop1407/chartjs-react-tutorial

  • @marcinn3668
    @marcinn3668 Рік тому

    After adding url to package.json, images with relative source path don't load for local server. Is there a way around it?

  • @anasfaisal5433
    @anasfaisal5433 2 роки тому

    thanks a lot! it's helping me on my course task, i'm from Indonesia by the way. And in Indonesia we'll say "mantaps 👍"

  • @shivsaxena90
    @shivsaxena90 Рік тому

    that's what I was looking for thank you (dhanyawad)

  • @giorgikiladze1151
    @giorgikiladze1151 Рік тому

    man thank you very much it was really helpful

  • @ChinonyeremBlessing-ty1ic
    @ChinonyeremBlessing-ty1ic Місяць тому

    Thank you so much for this 😊

  • @Awarix
    @Awarix Рік тому

    So how can I deploy other repository now? For example, I'm working on several projects, how to jump from one to another?

  • @JoseGomez-ie3mi
    @JoseGomez-ie3mi 3 місяці тому

    You are amazing.. So well explained.

  • @waelsta3103
    @waelsta3103 2 роки тому +3

    Ure my age and honestly ure such an inspiration … keep going man i love your videos

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому +2

      Thank you hahaha If it serves as motivation, I started learning react in the beginning of 2020 so you can learn a lot in a small amount of time!

  • @howtodoit1111
    @howtodoit1111 Рік тому

    Thank you so much, brother! You earn a subscriber.

  • @djlastnight1
    @djlastnight1 Рік тому +1

    Very usefull video! Thx

  • @mofahad1405
    @mofahad1405 6 місяців тому +1

    where did you get the codes to enter in terminal?

  • @OddSpeech
    @OddSpeech Рік тому

    This helpped more than the documentation

  • @gouravbhardwaj423
    @gouravbhardwaj423 5 місяців тому

    Hey Pedro, I got the project in a subfolder in my main github repo, how do I host that project? Is it by changing the option where it said "root" in your video?

  • @naufalfirdaus9875
    @naufalfirdaus9875 Рік тому

    This is really helpful for me as a beginner, thanks a lot bro
    Anw, is it possible to modify the app after it is deployed?