System Log #8: Automatically deploying

On Sebastian LaVine's Blog
Published on

In a previous entry I discussed how I made my website automatically deployable. Now the time has come to do the same with my main website,

For the time being, the website is written in pure HTML/CSS (edit 2024-03-05: this is no longer true; I use Markdown, Sass, and kiln), so unlike (which uses m4) there is no build step required.

A difference is that in addition to these text files, I also have several large binary files such as images and PDFs that I obviously do not want to check into version control. For right now, I'm just not going to use rsync's --delete option, which I use in to remove any old stale files. For the future, though, I've been thinking of a solution that involves

The devil is in the (implementation) details, but I think it could work. I've skimmed the website for git-annex and it looks like it uses a similar approach. Needs more research.

I could also embrace a third-party host (or first-party "third-party" host, using tmp or similar) to have all of my static files located on a subdomain, sidestepping the issue.

Anyway, the actual steps to create the user on my VPS were largely the same as those to create the user:

root@blue:~# useradd -m -s /bin/bash
root@blue:~# groups :
root@blue:~# passwd
New password:
Retype new password:
passwd: password updated successfully
root@blue:~# chown -R /var/www/

I also took this opportunity to clean up some file permissions on my system that were more liberal than I would have liked. Oops.

I created an SSH keypair with

$ ssh-keygen -t ed25519 -N '' -C " deployment key" -f

then copied the public key to /home/ and registered the private key as a secret on

After that, using as a template, I wrote up a new build manifest and Makefile, and crossed my fingers:

master$ git push master -o visibility=public -o description='Personal website'
Enter passphrase for key '/home/sebastian/.ssh/id_ed25519':
Enumerating objects: 87, done.
Counting objects: 100% (87/87), done.
Delta compression using up to 4 threads
Compressing objects: 100% (86/86), done.
Writing objects: 100% (87/87), 30.30 KiB | 6.06 MiB/s, done.
Total 87 (delta 31), reused 0 (delta 0), pack-reused 0
remote: Build started:
remote: [.build.yml]
 * [new branch]      master -> master
master$ sleep 30; hut builds show
#851290 - ✔ SUCCESS
✔ build  ✔ deploy

  [caf87fa][0] — [Sebastian LaVine][1]

      Add build manifest, Makefile


Ta-da! I'll work more on making it easier to add new content to the site later, but for now, being able to quickly modify what is already there is very helpful.