I have personal blog in github repo myname.github.io, i generates my site contents using Cabin site generator which generate build files in public folder. I wanted to serve the contents from public folder for Github pages. But it is always looking at the root folder.
Is there any option to tell Github to serve contents from public folder, not from root folder?
First, you need to sign-up for an account in GitHub, then you need to choose a plan that is suitable for hosting your project. There you will find a “New Repository” button, click that. This repository is like a folder in our computer. Now you need to Import Code, by clicking the button with the same title.
You can only deploy static sites on github pages. You can't deploy a server on github pages.
It is possible to use GitHub Pages with a private repository. GitHub Pages is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.
.gitignore file
(it’s ignored by default by Yeoman).git add dist && git commit -m "Initial dist subtree commit"
Use subtree push
to send it to the gh-pages branch on GitHub.
git subtree push --prefix dist origin gh-pages
Source: https://gist.github.com/cobyism/4730490
Go to the settings of the project and set the gh-pages as the branch for the website
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With