After a lot of pushing and pulling from Github repo, searching through this forum with similar titles and following the docs I am still not able to view my site as I can see on my local device. Github repo.
The website when opened shows readme instead of the site. I did do ./deploy.sh but it only pushed the folder but not contents as seen in the repo.
I need help in successfully deploying the site at a go.
EDIT : Will creating a local temp repository to build site work same as creating a seperate repo to host hugo files?
Okay well geez, I was able to do it with a local repo.
The deployment steps are not very easy to understand for a first time Hugo user and might help with some github action to do everything through it instead of going through countless tries.
Here’s what I did in case if someone stumbles like me and doesn’t find anser even from many such similar posts here to try this one out too.
Create your standard hugo site as mentioned in the hugo docs.
Once created run hugo to build your site and hugo server afterwards to verify that everything is sailing smoothly.
create a folder named hugo site and run git init which will initialize a empty git repo to your local device. No need to create a github repo just to host these files although if it is suggested in the docs you can do that too but not necessary I guess.
Copy the created site to the folder we just created in step 3 except the public folder(we’ll do that again).
Now you are in your main site with all the hugo files as well as your site. It’s time to deploy.
Create a github repo now that will host just the site and not hugo files with whatever site name you want, you can refer github pages document for more info.
git submodule add -b master https://github.com/<USERNAME>/<USERNAME>.github.io.git public run this command using the info from repo the above you created. This will add an empty public folder in the directory you are working in.
Create the deploy.sh file as mentioned in the hugo docs, you can run sudo gedit deploy.sh and save the contents from docs in it and then run it. link to deploy.sh
You site is now ready to view at https://github.com/<USERNAME>/<USERNAME>.github.io s site page on master branch itself.