3 ms·
As someone who just moved away from the exact Github->Netlify-Cloudflare stack... here's my two cents. Yes, it does make deploys easier. You don't "have to thi
by ryanmjacobs 6y ago
As someone who just moved away from the exact Github->Netlify-Cloudflare stack... here's my two cents.
Yes, it does make deploys easier. You don't "have to think" anymore. Well, that's the argument.
I self-host by creating a git bare repo on a server, ala `git init --bare mysite.com.git` and cloning that repo again for the web server (`git clone mysite.com.git mysite.com`). Now add this git hook in the bare repo:
#!/bin/bash
cd /home/ryan/mysite.com
unset GIT_DIR
git restore .
git pull
exec ./build.sh >/dev/null
Now my deploys take a second and become visible immediately. If you are intending on serving 1000s of requests per second, sure you might need CDNs and caching. But... if your hosting a portfolio/blog website, you might not need it. On top of that, demonstrating knowledge of backends is never a bad thing for a personal website.
- oefrha 6y ago1. Your deployment is not atomic. Probably should consider checking out to and building in a different directory, then atomically switch (symlink is an easy way to achieve atomicity). 2. Using a good CDN ensures your site is fairly responsive on (hopefully) all continents. Your server probably isn’t. Your closet server — even less.
- ryanmjacobs 6y agoOh shoot yeah symlinking sounds like a good idea. I should try that out. The thing is, for the amount of visitors I have, both of those points are kinda moot.
- oefrha 6y agoAtomic update is just good engineering practice regardless, and it’s pretty easy to work into your existing flow. As for responsiveness, it’s a good thing to proactively prepare for an HN hug of death ;) It also starts to matter when the traffic crosses into 100k a day, as is the case in TFA.