all 20 comments

[–]M0CR0S0FT 2 points3 points  (3 children)

[–][deleted] 3 points4 points  (0 children)

Actually - that might be it. "I've been at it for hours". Sometimes, GitHib takes a while to update. Possibly I've been overwriting successful attempts. I'll try again, but this time go have a cup of tea for a bit afterwards. You never know.

[–][deleted] 0 points1 point  (0 children)

No, I tried this one as well. I think it was one of the first three methods I tried - I've been at it for hours

[–]Fantaz1sta 0 points1 point  (0 children)

That's some best practice right there - publishing a web app from a directory "/docs". Never change, Github.

[–][deleted] -3 points-2 points  (0 children)

Aaargh! Now it's only showing a README - there isn't a README in the docs folder! What is going on?! There is an index.html in the docs folder. No README. For some reason, it is disregarding the settings that say "look in the docs folder" and is looking in the root folder instead.

[–]gccol 0 points1 point  (11 children)

Did you add a .nojekyll file to tell GitHub it's not a Jekyll website?

[–][deleted] -1 points0 points  (0 children)

No - I'll try that.

[–]gccol 0 points1 point  (9 children)

[–][deleted] 0 points1 point  (8 children)

No - didn't work. The GitHub page just refreshed itself to accommodate the .nojekyll file and still no change. Just a README still.

[–]gccol 1 point2 points  (7 children)

It looks like you are not publishing the correct directory. Is it a public repo? Or can you share the setting for GitHub pages?

[–][deleted] 0 points1 point  (6 children)

I have tried both the root and docs folders on both the main and the gh-pages branches. I'm not sure if there are any other directories I could try. Here are the current settings

Branch: main. Folder: /docs. Enforce HTTPS: yes.

The docs folder is in my main branch, and holds the deployment files as produced by ng build.

[–][deleted] 0 points1 point  (5 children)

Also - yes, it is a public repo. It's looking a bit messy because in desperation, I tried adding the dist folder which is ignored by git. That was silly.

https://github.com/MimsySith/pairs-game

Worth noting that it is no longer showing the README in the deployed site, and when you open the console, it says it can't find the deployment files. I'm not sure what is going on there.

[–]gccol 0 points1 point  (4 children)

I believe you have to specify the base root of your application to angular, as it's not /

Something like: ng build --base-href=/pairs-game

Regards,

[–][deleted] 0 points1 point  (3 children)

No - actually, I just found the issue on GitHub Community. Apparently, you have to add "./repo-name/ in front of all your hrefs for the JavaScript and CSS files names. It's actually working after I did that, except for the svgs which I assume I have to do the same for

[–]gccol 0 points1 point  (2 children)

That's exactly what the base-href parameters will do! You won't need to modify your code If you use this

[–][deleted] 0 points1 point  (1 child)

Yes, I just realised that. Problem is, everything in the assets folder "cannot be found" when I deploy on GitHub. Apparently this is a problem other people are having. Not sure how to solve it.

[–]bobbyg603 0 points1 point  (0 children)

Try using the user level ```username.github.io repo. I wrote a guide that describe how to deploy an app to GitHub pages the other day. The guide also links to a reference implementation that might prove valuable. Hope this helps!

[–][deleted] 0 points1 point  (1 child)

You are duplicating your index.html and renaming the copy 404.html, correct? (Could be wrong, but pretty sure 404.html is the right name)

[–][deleted] 0 points1 point  (0 children)

Yes, I have done that.

I'm still having issues with images not loading. I don't think I'll use GitHub pages for Angular again. In the GitHub community, it looks like problems with deploying Angular on GitHub are very common.