-
Manual deploys
This website has been deploying using a GitHub Action for a little while now. The idea is that when I push new changes, the website should pull those changes down from GitHub and then do a little song and dance to install dependencies and bust caches. Simple enough.
Or so you'd think! I struggled for a while to figure out a good way to handle this—using Deployer, trying to find a cheaper alternative to Forge, finally settling on what felt to me like a bit of an icky method: getting GitHub to SSH directly into my VPS and run the commands. This necessitated putting credentials in a GitHub "Secret", which I'm sure has top-notch security but felt like an unnecessary broadening of my attack surface.
Well, no longer. The GitHub Action, after 250-odd runs, is no more. Instead, I've written a simple bash script that runs the deployment commands, and which I trigger from my computer instead. Manually SSH-ing into my server and running the command explicitly would be tiresome, so I've written a small alias for it instead:
alias deploy='f() { ssh <my-server> "cd /path/to/www/$1 && ./deploy.sh" };f'
which I can then run pretty simply:
$ deploy charlesharri.es
There are a few benefits to doing it this way:
- I'm a lot more deliberate about re-deploying my site
- I don't have to keep secrets on GitHub
- I don't have to debug GitHub Actions when something invariably falls over
- I can redeploy arbitrary sites on the same server, so long as they have an executable
deploy.sh
script at the project root
#3 is the big one for me; time will tell how much more or less productive this workflow actually is. I suspect it's not going to make much of a difference.
Next
My first outing at a cross-country running event. Rain before, mud during, and lots of cake directly afterwards.
Previous
A website that is actually a spooky castle that you can go visit from the comfort of your very own personal sofa.
Archive
Posts Stream Books Walks • Clear filters
2023
September 2023
July 2023
June 2023
April 2023
February 2023
2022
December 2022
November 2022
October 2022
September 2022
August 2022
-
Bad coffee
29 -
Blurry gradient blobs pt. 2
26 -
Replacements for social media
23 -
Converging on peak gradient
19 -
Polyphasic sleep
18 -
Hard problems in the browser
17 -
Hot weather
16 -
Fun w/ hsl pt. 2
15 -
Blog v4
12 -
Microsoft Fluent Emoji
11 -
Meta's in-app browser tracking
10 -
Play.gl
9 -
Cache busting with GitHub Actions
8 -
Blogging on JS frameworks
6 -
Fun with hsl()
5 -
WebDriver
3 -
Broken luxury goods
3