hello, sourcehut

I made an account back in 2018-11-16, and have really enjoyed watching this platform develop. The focus on easy to use, low level tooling, and no nonsense ui design always picqued my interest. However, because I forgot and pages is a somewhat new feature, I launched this site on GitLab. Time to fix that with you now with pages.sr.ht, git.sr.ht, and builds.sr.ht.

My muttersprache is Go, so I started this whole endeavour with Hugo, and it seems pretty good so far. Between the Hugo and sourcehut pages quickstarts, I will leave it as a exercise for the reader to get a site like www.urandom.co.uk deployed. Fair warning before proceeding, builds.sr.ht does require a paid account.

With that, feel free to create and push your code up to a repo, I chose www, and yes you can use Git or Mecurial. With that out of the way, we need to add a trigger, .build.yml for builds.sr.ht.

# .build.yml
image: archlinux
packages:
  - hugo
  - hut
tasks:
  - build: hugo --source www
  - package: tar -C www/public -cvz . > site.tar.gz
  - deploy: hut pages publish site.tar.gz --domain www.urandom.co.uk --not-found /404.html
oauth: pages.sr.ht/PAGES:RW

After picking the image of your choice, add packages Hugo for build and hut for deploy. We need to define our tasks to prepare and publish the website. Finally, the oauth parameter is used to give hut permission to deploy.

Push your code, check for a new build job and that should be it, massive credit to Drew DeVault and the team for making this turn key. Their use of standard interfaces and logical components means that compatibility and integrations just work in a way that others struggle with.