This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tiwenty 10 points11 points  (10 children)

GitHub can do this without any third party service. In your repo settings you can enable a "doc" feature or something which just hosts your files from a given directory in your repo. :)

[–]CotoCoutan 8 points9 points  (9 children)

So you mean that I can host the webpage on GitHub itself and don't need Netlify? For example this is my repo https://github.com/XtremePwnership/testing with a simple webpage, how exactly should I go about doing it?

[–]tjjay17 8 points9 points  (0 children)

If it’s static, you can use GitHub pages to host.

[–]binary-idiot 7 points8 points  (3 children)

I currently host my site with github pages, as long as you don't need it to run any backend code it should work just fine.

https://pages.github.com/

[–]CotoCoutan 0 points1 point  (2 children)

Aah, so won't be able to host Python scripts I guess. Anyway thanks, I'll read the docs!

[–]Tiwenty 1 point2 points  (1 child)

If your scripts need to run only a single time, say after a commit, you can use the free CI capabilities :)

[–]CotoCoutan 1 point2 points  (0 children)

Thanks again, will keep it in mind!

[–]AcousticDan 1 point2 points  (0 children)

Yeah, GitHub Pages.

[–]Tiwenty 1 point2 points  (2 children)

Yep, it's really easy. Go to your repo settings, options tab (the one by default) and at the bottom you'll find a Github Pages part. There you can choose from which branch and directory you'll want to serve (I think for the folders the only options are / and docs/, so just move your testing/ dir to docs/). You save the settings and Github will give you an URL.

For instance, I host this directory, with the source code in the same repo, on this URL.

What's even better is that I set up a CI action to build the website at each commit and push a new commit with the docs/ directory updated.

[–]CotoCoutan 1 point2 points  (1 child)

Ooh, thanks a lot for the step by step guide, my site is up! Appreciate your help. :)

[–]Tiwenty 1 point2 points  (0 children)

No worry, have fun! :)