5 ms·
I use Github to host the source for my blog/website which is open source. Jekyll for the building which happens on Travis CI. Deployment on S3 with cloudflare a
by K0nserv 10y ago
I use Github to host the source for my blog/website which is open source. Jekyll for the building which happens on Travis CI. Deployment on S3 with cloudflare as a CDN for SSL and reduced bandwidth. I really like this setup. I wrote a guide called The One Cent Blog[0] a while back detailing how it's setup. Typical months the cost is around $0.01-$0.03.
Becuase people usually ask why S3 over Github pages I'll answer it up front. Github pages is too limited in terms of what you can do with custom jekyll plugins and code.
0: https://hugotunius.se/2016/01/10/the-one-cent-blog.html https://hugotunius.se/2016/01/10/the-one-cent-blog.html
- 0xCMP 10y agoHowever, you can simplify this on your computer like I do by having a repo with your source, disabling jekyll on github, and pushing the results to the user.github.io repo so that github acts like s3 and you get a $0.00 blog. Nice thing for S3 though is you could cloudfront it if you wanted to for some reason. And it's in your control.
- jrheard 10y agoYeah, I do this too - https://github.com/jrheard/blog https://github.com/jrheard/blog is my source, https://github.com/jrheard/jrheard.github.io https://github.com/jrheard/jrheard.github.io is the generated static site. This allows me to use whatever Jekyll plugins I want. I literally wholesale copy-pasted the Rakefile in http://ixti.net/software/2013/01/28/using-jekyll-plugins-on-github-pages.html http://ixti.net/software/2013/01/28/using-jekyll-plugins-on-... in order to set this up, it was very easy thanks to that great article - all you have to do is run `rake publish` at the command line, and your site builds locally and the finished product is deployed to your github pages repo.
- positr0n 10y agoI like your Travis CI setup, I may copy it myself. Here's the workflow I currently use if the OP wants something with less moving parts. I just use s3_website from the command line. It will even create the s3/cloudfront configuration completely automatically. gem install s3_website ; set up s3_website.yml and AWS environment variables s3_website cfg apply ; this creates and configures the S3 bucket and cloudfront configuration s3_website push ; push to S3, invalidate cloudfront caches
- kzisme 10y agoIf you're just hosting a static blog website/personal site - is it really worth using Travis on it? I've yet to use it on mine and curious if I should start essentially.
- erikbye 10y agoNo. People add so much unnecessary overhead and bullshit these days. All you need for static is a push from local to your host with SCP. A one-line script if you include some markdown to HTML, or just use Jekyll and straight SCP that.
- kzisme 10y agoI figured as such...I just use Github Pages with my own domain, develop on one branch and push changes to gh_pages...and done. Simple and fast.
- K0nserv 10y agoTo each their own. I actually think this setup is much simpler. I just have to push to git which I'd be doing in any case and it automatically deploys everything. If I were to manually sync I'd both have to remember that and I'd have to figure out a secure way to store the credentials.
- sangupta 10y ago+1 For basic blogs/sites github pages are free and fast. For all custom static sites I run a local Jekyll setup with multiple plugins and push the _site folder to Github for free hosting.
- TheArcane 10y agoI don't understand why you need the S3 if you're already hosting it on github pages.
- K0nserv 10y agoSorry about the confusion. The source[0] is hosted on Github, but the actual page when compiled to static files is hosted on S3. 0: https://github.com/k0nserv/hugotunius.se https://github.com/k0nserv/hugotunius.se
- marcamillion 10y agoYeh I think everybody is saying that if you are already hosting the source on GH, there is no need to host the static files on S3 -- you may as well just host it on GH:pages, because that will be free and you get all the benefits of S3.
- TheArcane 10y agoPlus, you can use custom URLs on Github pages.
- pg_is_a_butt 10y agoyeah, people compile web pages now. i don't understand it either.
- user5994461 10y ago> Typical months the cost is around $0.01-$0.03. For how many visitors?
- K0nserv 10y agoNot that many admittedly, about 10k requests from 1.5k unique users in the past month. With that said 10m requests would still only come out at $4 so it's still a good choice for most low traffic sites.
- user5994461 10y agoI just checked one article on my WordPress to have a point of comparison. That's 87 requests total and 4.7 MB. The first page of HN (and reposts) will bring over 100k views in the month. Either I'm crazy, or that's about 1M HTTP requests and 500 GB of traffic to serve u_u Serving that over S3 or CloudFront would be $45 (mostly traffic charge). OMG. Definitely not a bill i want for my personal blog. That's a great idea for a future post: "The day I listened to HN advice and bankrupted myself by hosting my blog on S3". With a live counter and animations to see how much each visitor is ruining me in real time, it will be awesome! :D
- Jack000 10y agoI used to have my site on s3, but the last time I was on hn I got dinged $450 (images and 4k videos) now I self host with failover to s3.
- K0nserv 10y agoI guess it depends on your page size. My pages average around 10kb and make two requests per page. At 1m hits that's still only $0.80 if we don't include Cloudflare reducing the number of requests that reach S3. If anything 87 requests and 4.7mb makes it sound like you have a bit of an obesity[0] problem on your blog. 0: http://idlewords.com/talks/website_obesity.htm http://idlewords.com/talks/website_obesity.htm
- 10y ago