-
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
May 2023
April 2023
February 2023
January 2023
2022
December 2022
November 2022
October 2022
September 2022
August 2022
June 2022
May 2022
-
Proton.me
25 -
Shared Element Transitions
22 -
A short review of CraftCMS
21A quick look back on how CraftCMS is working out for me, after a few months of using it.
-
Constraint Validation API
18 -
Form input inconsistencies
17 -
Tyler Angert's Stream
16 -
:target navigation
3 -
SpaceX docking simulator
3
April 2022
February 2022
2021
December 2021
July 2021
-
Innovation in tech
10I'm extremely tired of the powerful in tech holding the rest of us hostage in the name of innovation.
June 2021
-
Thoughts on margins
5Some thoughts on how to use margins in CSS. Needlessly opinionated.
May 2021
-
TailwindCSS
8A bit of meta-commentary on Tailwind CSS' description: "Tailwind, like most CSS frameworks, solves a problem really well. Its supporters, on the other hand, are a pain.
March 2021
-
As Much JavaScript as Possible
1Some thoughts on JavaScript outside of the browser and its unpopularity in Big Tech.
2020
December 2020
-
WordPress in 2020
15In 2020, WordPress remains relevant and dynamic as ever. But it's still got a few pain points.
September 2020
-
Per-user data encryption
13How I built a user-password-based encryption system that even the database owner can't break.
May 2020
-
On good code
6Some thoughts on how to determine whether code is good.
2018
June 2018
-
Use SQLite with PHP
23They say you learn best when you try to teach someone else. So here I am, trying to teach... myself.
May 2018
-
Rails redirects with regex
17How to redirect routes with Rails, but only if they match a given regex.
2017
November 2017
-
Publish a package for the Atom editor
25How to publish a package to the Atom text editor repository.
August 2017
-
System fonts
25A short bit about using the fonts that your users' computers come with.