Deploy Vite app to GitHub Pages using GitHub Actions

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025

ความคิดเห็น • 111

  • @krzysztofkrawczynski9404
    @krzysztofkrawczynski9404 4 หลายเดือนก่อน

    That worked great, thank you. I appreciate that you attached step-by-step instructions and workflow script. Well done!

  • @dpeedits
    @dpeedits 6 หลายเดือนก่อน

    the fix for me was giving permission to github action to write, I spent 3 days searching for a solutions why my website not working, and your video is the only one that worked for me by that simple, yet very important thing, thanks a lot 🙏

  • @darellegochuico4398
    @darellegochuico4398 ปีที่แล้ว +2

    Of all the tutorials, this one worked flawlessly

  • @jagcheema3934
    @jagcheema3934 ปีที่แล้ว +2

    your awesome thank you man followed every step and it worked just as you explained

  • @kenyandev
    @kenyandev ปีที่แล้ว

    had trouble with my github actions and this saved. Thank you Maciek Sitkowski

  • @higara_
    @higara_ ปีที่แล้ว

    Finally a well explained video of each step and why we are doing it. Thank you so much for the explanation on the wrong asset links! thumb up and bookmarked for future reference

  • @ivanwritescode
    @ivanwritescode ปีที่แล้ว +1

    Works like a charm. Very well explained. Thank you!

  • @blackkenshi222
    @blackkenshi222 ปีที่แล้ว

    Dude you are the best ! I've been trying to solve those errors for days and it worked ! Thank you very much !

  • @RickHardBR
    @RickHardBR 2 ปีที่แล้ว +1

    Witaj Maciek, pochodzę z Brazylii i właśnie zacząłem pracę w obszarze DEV, zrobiłem swoją pierwszą aplikację na Vite i nie wiedziałem, jak to zrobić Deploy, nawet widząc dokumentację wydaje się to trochę mylące, ale oglądanie twojego wideo i nawet nie znając angielskiego udało mi się wgrać swoją aplikację na github. Dziękuję Ci bardzo.👏

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว

      Hej Ricardo, bardzo się cieszę, że Ci pomogłem!

  • @thatsalot3577
    @thatsalot3577 ปีที่แล้ว

    You're a lifesaver man, I pray that you live a happy life.

  • @sul9343
    @sul9343 ปีที่แล้ว +1

    Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec

  • @Fingerstyle-Magazine
    @Fingerstyle-Magazine 8 หลายเดือนก่อน

    Djekuje bardzo sir, you saved my nerves

  • @z0miren
    @z0miren 2 ปีที่แล้ว +2

    Thank you very much! You saved my nerves! :) Cheers, my Polish friend!

  • @alexseeley1146
    @alexseeley1146 6 หลายเดือนก่อน

    This is a godsend - thank you

  • @MineFanist
    @MineFanist ปีที่แล้ว

    You are a legend my friend. Thanks alot!

  • @celsonfernandogamer
    @celsonfernandogamer ปีที่แล้ว

    Thanks very much, I'm Full Stack Developer from Brasil.

  • @2difficult2do
    @2difficult2do ปีที่แล้ว

    Thank you, your tutorial is great and useful, you helped me very much!

  • @macieksitkowski
    @macieksitkowski  ปีที่แล้ว +2

    Vite's docs for deploying to GitHub Pages:
    vitejs.dev/guide/static-deploy.html#github-pages
    Example with a custom domain:
    github.com/sitek94/vite-deploy-demo-custom-domain

  • @RicardoChase894
    @RicardoChase894 ปีที่แล้ว

    awesome man!!!

  • @Andrey-z1k
    @Andrey-z1k 9 หลายเดือนก่อน

    thank you very much, the awesome tutorial

  • @main_mercy
    @main_mercy ปีที่แล้ว

    Thanks for your video! It worked very well!

  • @Noam-Bahar
    @Noam-Bahar ปีที่แล้ว

    Works flawlessly! Thanks!!!

  • @mdasifmunshe
    @mdasifmunshe ปีที่แล้ว

    Thank You ❤

  • @set_soul
    @set_soul ปีที่แล้ว

    You just saved my day

  • @nikunjmahajan4567
    @nikunjmahajan4567 ปีที่แล้ว

    What to change if i want to install packages using yarn

  • @VercJames
    @VercJames 2 ปีที่แล้ว +1

    I often get "vite' is not recognized as an internal or external command" from github actions

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว

      Can you send a link to your repo? I'll try to take a look when I get a minute

  • @matheusvianam
    @matheusvianam 5 หลายเดือนก่อน

    Thank you!

  • @DavidAsatrian
    @DavidAsatrian ปีที่แล้ว

    Thanks Maciek, this was helpful!
    I went with 'actions/upload-pages-artifact@v1' and 'actions/deploy-pages@v1' instead of 'peaceiris/actions-gh-pages@v3' so there's no need to upload/download artifact or use a 'gh-pages' branch.

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว +1

      Hey David, thanks for the tip, I have to check it out!

  • @kr4chinin771
    @kr4chinin771 2 ปีที่แล้ว +1

    Thanks, worked fine!

  • @WiLLo1987
    @WiLLo1987 2 ปีที่แล้ว +1

    Thanks for this, I tried a few different ways, none of which worked. Also, I was having trouble with this and realised in the deploy.yml the branch was main wheras for me its master, so I changed those and it worked!

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey William, I'm glad you got it work, cheers!

  • @martinfernandez4467
    @martinfernandez4467 ปีที่แล้ว

    Does this work with Vue Vite?
    I don't know how to deploy my Vue Vite project on GitHub...
    Also, it uses a local api that I run myself in the terminal every time. So how would I make that work on GitHub?

  • @csmt12
    @csmt12 ปีที่แล้ว

    I get this error:
    Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey there, can you send a link to your repo?

    • @csmt12
      @csmt12 ปีที่แล้ว

      @@macieksitkowski Hey, ended up switching to create-react-app in the end. Thanks for the content!

  • @chetankhulage
    @chetankhulage 2 ปีที่แล้ว +2

    thank you so much 💗💗

  • @emilzyka6853
    @emilzyka6853 ปีที่แล้ว

    Thank you, works great! :)

  • @keithprakash9955
    @keithprakash9955 ปีที่แล้ว

    hey Maciek, it worked on demo project.. btw i tried to host a portfolio.. it won't work on it.. just gives a blank page. with a error " Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.".. need bit help to fix this issue

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey there, can you share a link to your repo?

    • @keithprakash9955
      @keithprakash9955 ปีที่แล้ว

      @@macieksitkowski yes

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Did you forget to share it? :D

    • @keithprakash9955
      @keithprakash9955 ปีที่แล้ว

      @@macieksitkowski i hosted it on netlify bro.. im working on a blog .. i ll surely use your help to host it
      😃

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      @@keithprakash9955 Netlify is great, I have my personal website there :)
      Deploying is also super easy, it's described here:
      vitejs.dev/guide/static-deploy.html#netlify-with-git

  • @ShintakuMic
    @ShintakuMic 2 ปีที่แล้ว

    Good Job!! Thanks for your time, great post!

  • @4XxswordxX4
    @4XxswordxX4 2 ปีที่แล้ว

    everything worked until the part about the vite config file. I don't have a vite config file and so I don't know how or where to add the base. my project is in Three js not react and so when I do upload it, it only takes the index.html and doesn't take the rest of my files which are basically the essential parts

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว

      Hey there, can you send a link to your repo?

  • @darioalves7739
    @darioalves7739 2 ปีที่แล้ว

    I deployed vite app on gh-pages succesfully but then when I created components folder etc, nothing was added or updated when I push.

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว +1

      Can you share a link to your repo?

  • @bernardus3289
    @bernardus3289 ปีที่แล้ว

    Thanks a bunch man, you really saved my neck here

  • @kamalashamilova8348
    @kamalashamilova8348 2 ปีที่แล้ว +1

    thank you for the tutorial . I've been searching for this. but I have one error about the img src . how can i add another basepath for the img src also?

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว

      Hey Kamala, I'm happy you liked the video!
      Regarding your issue, do you import your image?
      "import imgUrl from './img.png'"
      If you do it like this👆and you have a base path defined, then after building it should become "//assets/img.png".
      It's described in the docs here:
      vitejs.dev/guide/assets.html#importing-asset-as-url
      Also, take a look, how I import and use "logo.svg" in "App.jsx" file.
      If it doesn't help, send me a link to your repo, so I can take a look

    • @kamalashamilova8348
      @kamalashamilova8348 2 ปีที่แล้ว +1

      @@macieksitkowski I followed the link you send and it worked. thanks a lot👏

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว

      @@kamalashamilova8348 you're welcome :)

  • @iuriius
    @iuriius ปีที่แล้ว

    thank you very much sir

  • @vibestation23
    @vibestation23 ปีที่แล้ว

    So how to config when my vite app has routing

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey, you can check this app for more advanced example with routing:
      github.com/sitek94/football-app

  • @roqlee
    @roqlee 2 ปีที่แล้ว +1

    Thanks a lot!

  • @ConstantineKa
    @ConstantineKa ปีที่แล้ว

    Tell me, the project is on vite, but the package manager is on yarn?

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      In this example I'm using npm, but it wouldn't be a problem to use yarn or pnpm instead

    • @ConstantineKa
      @ConstantineKa ปีที่แล้ว

      @@macieksitkowski Resolve. The problem was fontawersome. They closed access to version 6.2.0. It gave a 404 error. Workflow went into a panic.
      Changed the yarn.lock file. Now success😀

    • @ConstantineKa
      @ConstantineKa ปีที่แล้ว

      Для русскоязычных. Возникла проблема, когда делал по инструкции. Погрешил что в видео npm, а у меня Yarn. Но в поисках решения заметил где-то, что не может установить библиотеку FontAwersome версии 6.2.0, помечает код ошибки 404. А еще не может найти библиотеку fortawesome/sharp-solid-svg-icons вообще ни какой версии.
      Аction сразу завершался с ошибкой.
      Решение-изменить файл yarn.lock (или package.json). Поменял везде(сочетание ctrl+H в любом редакторе😊) на версию 6.2.1 и удалил все упоминания данной библиотеки.
      Надеюсь кому-то помог)))

  • @amelianceskymusic
    @amelianceskymusic ปีที่แล้ว

    how to deploy Vite app with react browser router? CRA has fix in official docs, but Vite doesn't have=(

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Do you mean github.com/remix-run/react-router? I'm pretty sure it should work out of the box, I'm using react router in this app github.com/sitek94/football-app and it works fine.

    • @amelianceskymusic
      @amelianceskymusic ปีที่แล้ว

      @@macieksitkowski I've got 404 after reloading ...football-app/teams page. It's not what you expect=(

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      @@amelianceskymusic Ahhh, I see what you mean. Yeah, it was just a demo, so I didn't handle that, but I've fixed it now. Basically, you need to:
      1. Create `404.html` which stores the path that you want to access in sessionStorage and then redirects back to `index.html`
      2. In `index.html` before loading app script you check sessionStorage if there is something saved, and if so, you update the path and clear the storage
      You can check my latest commits here:
      github.com/sitek94/football-app/commits/main
      Hope it helps!

  • @ErZG
    @ErZG 2 ปีที่แล้ว

    Thank you for the video, but can you help me? GitHub Action always skip the Deploy part after the build, it says "This check was skipped".

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว

      Hi, can you share a link to your repo?

  • @agent4525
    @agent4525 ปีที่แล้ว

    Tried so many times it still not working for me. Just cant figure out what went wrong. 😰

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey, you can open an issue in my repo on Github and when I have a minute I'll try to take a look

  • @willitworks
    @willitworks ปีที่แล้ว +1

    can you do a video on how to deploy with pnpm ?

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey Mike,
      I've found a repo where I'm using pnpm:
      github.com/sitek94/football-app/blob/main/.github/workflows/deploy.yml
      It's all pretty much the same, except for:
      ```
      - name: Setup pnpm
      uses: pnpm/action-setup@v2.2.2
      with:
      version: 7
      - name: Setup Node
      uses: actions/setup-node@v2
      with:
      node-version: 18.2
      cache: 'pnpm'
      - name: Install dependencies
      run: pnpm install
      ```
      It's using this action to setup pnpm:
      github.com/pnpm/action-setup
      Let me know if it's of any help, and if not I'll create some example.
      Cheers

  • @MatheusOliveira46
    @MatheusOliveira46 2 ปีที่แล้ว

    Thank you very much!!!

  • @MrNik0l0z
    @MrNik0l0z 2 ปีที่แล้ว

    Thanks for the video. I did exactly what you did but mine only shows blank screen without errors, still updated base path still have blank screen.

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว +1

      Hey there, can you send a link to your repo?

    • @MrNik0l0z
      @MrNik0l0z 2 ปีที่แล้ว

      @@macieksitkowski Hey, to be honest, I didn't think that you would reply this quickly and since I needed to deploy it ASAP, I moved the project to Create React App and deployed that way.Many thnx for the quick reply and if i will have the same issue next time, i will come back xd

  • @hamidenajari1159
    @hamidenajari1159 ปีที่แล้ว

    thank you

  • @张三-i6n
    @张三-i6n 2 หลายเดือนก่อน

    What should I do if the third-party package cannot be parsed during the build?/(ㄒoㄒ)/~~

    • @张三-i6n
      @张三-i6n 2 หลายเดือนก่อน

      I've solved it and am now trying to deal with static files

    • @张三-i6n
      @张三-i6n 2 หลายเดือนก่อน

      Now the static resource succeeds, but the routing has an error /(ㄒoㄒ)/~~

  • @echendukwe1510
    @echendukwe1510 ปีที่แล้ว

    i have the same blank page even though i
    added the baseurl

    • @echendukwe1510
      @echendukwe1510 ปีที่แล้ว

      could it be because i'm using react router?

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      @@echendukwe1510 I've got another example repo with react router setup, maybe it'll help:
      github.com/sitek94/football-app

  • @m_jdm357
    @m_jdm357 ปีที่แล้ว

    Man that thing again does not work... :(

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Can you share a link to your repo?

    • @m_jdm357
      @m_jdm357 ปีที่แล้ว

      @@macieksitkowski I ditched Github Pages after days ... days trying. I deployed to Netlify, 0 configuration, just added _redirects file and it worked straight out of the box. I saw a freecodecamp article on how to deploy to netlify with create react app not vite.

  • @alvarobyrne
    @alvarobyrne 2 ปีที่แล้ว +1

    gracias hermano

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว +1

      de nada!

    • @alvarobyrne
      @alvarobyrne 2 ปีที่แล้ว +1

      @@macieksitkowski "de nada" is a good answer, but an even nicer one is "con gusto" which literally means "my pleasure".But it's not my intention to criticise your reply, you made a good effort to search for the answer, ha ha: thanks again, and again!

    • @macieksitkowski
      @macieksitkowski  2 ปีที่แล้ว +1

      @@alvarobyrne hablo un poco de español, pero no conocía esta frase. Muchas gracias, por enseñarme! :)

    • @alvarobyrne
      @alvarobyrne 2 ปีที่แล้ว +1

      @@macieksitkowski con gusto, ja ja

  • @zaidtehsin7096
    @zaidtehsin7096 ปีที่แล้ว

    Still not working

    • @macieksitkowski
      @macieksitkowski  ปีที่แล้ว

      Hey there, can you send a link to your repo?

  • @StartwithEnglish
    @StartwithEnglish ปีที่แล้ว

    deploy
    is waiting for github-pages deployment approval

  • @vuenice
    @vuenice 8 หลายเดือนก่อน

    voice not audable

  • @drious
    @drious 9 หลายเดือนก่อน

  • @elishababalola5895
    @elishababalola5895 ปีที่แล้ว

    Thank You very much man