GitHub Pages' via GitHub reads the README file instead of src folder

Edit: This is a Vanilla JavaScript Project with Tailwind Elements and Local Storage.

The method I’m used to before was through the terminal and by creating a new branch gh-pages and it’s usually on the root folder and I also forgot on how to do it. But that said, prior this post, this looks easier and straightforward. Publishing to GitHub Pages made me want to try it.

The issue I’ve encountered though is that GitHub pages publishes the README.md file instead of the files from the src folder.

How do I solve this issue? How do I publish the files inside the src folder?
image

When deploying to the GHPages branch, I usually copy only the content needed to the root folder and nothing else.

I’ve honestly tried that, however since this the CSS is managed by tailwind using postcss, the folder is configured prior dist folder.

More so, I have tried moving the files inside the src folder into the root folder. Though it works, the tailwind css does not work. The files are bare instead.

GHPages needs the index page to be in the root folder. No way around that. Id investigate how a project like yours is intended to be built and deployed.

Thanks for the reply, this was a practice project. I was trying out to implement tailwind using PostCSS on a vanilla project and since I managed to make it work, I thought I’d push through, however at the final stages, this issue really caught me off guard.

JavaScript is fine, I never expected that the UI would F me up. I’m honestly embarrassed. I should have stick to vanilla CSS instead.

If this is the case, I have a question, if by chance you encountered this issue, would it be better if I simply delete the whole repository and upload a new repository instead?

Edit : Spelling corrections

You don’t need to delete the whole repository to change the folder structure for the GHPages branch.

Oh, I should have added more info. I mean, I am wondering whether to discard the whole repository because the tailwind postCSS process because this is getting complicated, and whether I should simply just upload a new one that uses Vanilla CSS instead which is less of an issue.

You can try using the gh-pages npm package.

Personally, I would just use Netlify or Vercel, it is just a nicer workflow.


If you are not using Vite for this I would suggest doing so.

Change the template as needed

Or use one of the Community Templates made for Vanilla/Tailwind

Vite deploy docs


Post a link to your repo as well.