Publish your Kiln site on Sourcehut pages

Posted on on

Sourcehut recently announced free static hosting for Gemini and the web via Sourcehut pages.

Sourcehut pages announcement

To publish your Kiln site to Sourcehut pages automatically, you'll need to add the following build manifest in the file ".build.yml" in the root of your site repository:

image: alpine/edge
- kiln
- build: |
    cd $site
    kiln --html
- package: |
    cd $site
    tar -C dst -cvz . > ../site.tar.gz
    tar -C html -cvz . > ../html.tar.gz
- upload: |
    acurl -f$site \
      -Fcontent=@site.tar.gz \
    acurl -f$site \
      -Fcontent=@html.tar.gz \

This build manifest builds Gemini and HTML versions of your site and uploads both to Sourcehut pages. It will run automatically whenever you push a commit to your site repository, assuming that it is hosted on Sourcehut. Be sure to point your domain name towards Sourcehut pages' servers.

Sourcehut pages documentation

This work is licensed under a CC-BY-SA-4.0 license. Source code
Have a comment on one of my posts? Send an email