Search code examples
githubdeploymentgithub-pages

How to deploy a project on GitHub Pages from dist folder


I have built my project with parcel and it gave me all my files in dist folder and I push it to a repo on GitHub. now I have dist folder and also src folder ( which was for develop phase). How can I deploy the page from dist folder using git ( on Github site I only know how to deploy from main branch not from another folder). here is the repo address: click to go to repo


Solution

  • Rename your dist folder as docs on your local repository, git add, commit and push. After that open your repo, go to Settings > Pages, leave the source dropdown on "Deploy from a branch", on branch dropdown select your main branch and select the docs folder, and you are ready to go.

    enter image description here