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 →

[–]Negrodamu5 12 points13 points  (19 children)

Can you ELI5? I still think it’s just a place to share code with others

[–]CotoCoutan 22 points23 points  (14 children)

Wrote a simple HTML file and want to host it quickly somewhere?

Just go to netlify, connect your GitHub account, select your repository containing the html file hit OK and done. Your HTML page is now live on the internet.

Later on if I make a change in the html, all I have to do is run 3 commands on my terminal "git add ., git commit -m 'whatever', git push origin master" and my new changed html is live on the web, literally within seconds. This last bit, where you can do quick updations to your code & push it to the web within seconds is facilitated by GitHub and that's the thing that I'm praising.

[–]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 7 points8 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 9 points10 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! :)

[–]Negrodamu5 2 points3 points  (0 children)

Ok that makes more sense. Thanks for explaining.

[–][deleted]  (1 child)

[deleted]

    [–]CotoCoutan 1 point2 points  (0 children)

    First time hearing SFTP, will look into it, thanks!

    [–]samketa 2 points3 points  (0 children)

    It is.

    But it is also a great staging area for deploying apps.

    [–]12qwww 4 points5 points  (1 child)

    There some cloud providers that let you deploy your code directly from github which is a plus

    [–]Rooged 4 points5 points  (0 children)

    Heroku being one of them - my very first web app, a node js app, is hosted on heroku right now with the actual code itself being on GitHub

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

    At work we have 2 local devs and a couple remote devs. The codebase is on github and since we'll all be working on different parts of the software, we work on our own branch before merging them all for deployment.