Deploy Vite app on Github pages using Github Actions
ฝัง
- เผยแพร่เมื่อ 13 ต.ค. 2024
- Deploy your Vite app like Vue , React or ... on Github pages using Github Actions
github.com/ben... → benixal.github...
github.com/ben... → benixal.github...
00:00:10 create an app (Vue)
00:00:54 deploy on github.io
00:08:15 deploy on root domain
Keep up the good work! Just incase anyone was wondering, if your branch is master not main then you need to also change that in the workflow ( line 7 ) if you copied the workflow from vite 👍
*Thanks man I just learned from your video how to deploy an vite app on github pages! Thank you so much*
Glad it helped!
thanks man i find the best turtorial on the internet
Thank you so much! I'm glad you found the tutorial helpful.
This video saved me. Very thank u
Glad it helped
Thank you so much; you're a lifesaver!
IT WORKED 🎉🎉!!!
Thank you so much, afrer losing my mind these last few days ive finally fkund the solution!!!
You're welcome! 🎉 I'm glad my video was able to provide a solution for you!
Thank you so much! It's really helpful!
You're welcome! Glad it was helpful!
Thanks a lot. You teach to the point..
Thank you so much. This helped me a lot
Glad it helped!
Thenks! this is great
is this work when we use axios and fetch an API??
Yes, it should work, but remember to check CORS
en.wikipedia.org/wiki/Cross-origin_resource_sharing
Thank you very much bro👌👌👌👌
Thank you! very helpful
Very useful thank you!
You're welcome! Glad it was helpful!
Do you have idea maybe why i don't have nothing in my workflow while i did everything like in this tutorial?
If you don't have anything in your workflow, it's possible that you forgot to include the ".yml" extension when creating the deploy.yml file. Make sure the file is named "deploy.yml" and contains the necessary configuration for your deployment. Let me know if you have any other questions.
@@benixal I remembered the extension, the only thing I have been able to do is "deploy static content to pages" but it is not ideal....
Another possible cause for the issue you're facing is forgetting to run "npm install" before deploying your application. This can result in an error message such as "Dependencies lock file is not found," which will cause the operation to halt.
@@benixal I read somewhere that the main base url should be '/repo' and currently according to the documentation I have '/repo/' but I don't know if this could be the cause of the error
Please refer to the 03:23 in the video where I explain the base URL configuration. Additionally, you can check the following link for the contents of the vite.config.js file in your repository: github.com/benixal/myapp/blob/main/vite.config.js (which is for: benixal.github.io/myapp/) This file should provide insight into the base URL configuration and help determine if it could be the cause of the error you're experiencing.
Thank you very much, your clip is very helpful
Thank you! I'm glad to hear that the video was helpful to you.
Thank you so much, it's save my lifeeee
Glad it helped! 🙌
Thank you very much
You are welcome
Life-saver!
Happy to help! 🚀
Thank you very much, but there is still a problem, which is that when I'm not on the home page and reload, a 404 error appears
You're welcome Ahmed!
just add these lines (after the `run: npm run build`) to your deploy.yml file:
- name: fix 404
run: cp ./dist/index.html ./dist/404.html
Example: github.com/benixal/my-vue-app/blob/main/.github/workflows/deploy.yml
Demo:
benixal.github.io/my-vue-app/
benixal.github.io/my-vue-app/foods
benixal.github.io/my-vue-app/profile
@@benixal it works, thanks a bunch🌹🌹🌹
Thanks for help Bro! Have someone limit for number of pages?
Thanks for watching! Regarding your question, could you please clarify what you mean by 'limit for the number of pages'?
@@benixal Can I have multiple pages for each of my projects?
Yes, you can have multiple pages for your projects on GitHub Pages. It supports both single-page applications (SPAs) and multi-page applications (MPAs). So, depending on your project's requirements, you can deploy either a single page with client-side routing (SPA) or a traditional multi-page website (MPA)
Can use nuxt?
I have deployed but it is showing the read me file as hosted file
Thanks man ❤
You're welcome! 🚀
helpful video
Glad it helped
You are the goat
Thank you, I appreciate that! 🙏
Thanks a lot!!!
You're welcome! I'm glad the video was helpful for you.
thanks
You're welcome!
its giving empty page
Check the console logs
10wpm lol
Watch it at 2x speed! 😄
Run npm run build
> nodejs-chat-frontend@0.0.0 build
> vite build
sh: 1: vite: Permission denied
Error: Process completed with exit code 126.
got the same problem, did you manage to solve it?
Promo_SM 😅