Rista

Cloudflare and GitHub Pages

rista setup writes the files a host needs into the site. It does not deploy anything. A GitHub Actions workflow builds the site on every push to main and hands the result to the host.

bundle exec rista setup cloudflare
bundle exec rista setup github-pages

A file that is already there is kept. Pass --force to replace it. Each command ends with a list of what is left to do by hand.

Cloudflare

Cloudflare serves a directory of files from a Worker, for free. It serves /blog from blog/index.html, redirects /blog/ to /blog, and answers a missing path with the nearest 404.html and status 404, as rista serve does.

rista setup cloudflare writes three files:

FileWhat it does
wrangler.jsoncnames the Worker and points it at out/
public/_headerscaches the hashed files under /assets/ forever
.github/workflows/cloudflare.ymlbuilds the site and runs wrangler deploy

--name sets the name of the Worker, which is the name of the site’s directory by default. The site is served at <name>.<account>.workers.dev until it gets a domain in the Cloudflare dashboard.

Left to do:

  1. Create a Cloudflare API token from the “Edit Cloudflare Workers” template.
  2. Add CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID as secrets of the repository on GitHub.
  3. Run bundle lock --add-platform x86_64-linux-gnu, so the workflow can install the gems.

To deploy from your own machine, without the workflow:

bundle exec rista build
npx wrangler deploy

Connecting the repository in the Cloudflare dashboard does not work. Cloudflare’s own build has no ImageMagick, which a Rista site needs.

GitHub Pages

rista setup github-pages writes .github/workflows/github-pages.yml, which builds the site and publishes it.

Left to do:

  1. On GitHub, set Settings > Pages > Source to “GitHub Actions”.
  2. Run bundle lock --add-platform x86_64-linux-gnu.
  3. A site at https://<user>.github.io/<repo> is under a sub-path. Set base "/<repo>/assets/" in klenod.config.rb, and that address as :url in src/site.rb.

GitHub Pages differs from the other hosts in two ways:

  • It redirects /blog to /blog/ when the file is blog/index.html. So the workflow builds with --flat, which writes blog.html. GitHub Pages serves that at /blog as it is.
  • It answers every missing path with the top-level 404.html. A not-found page in a subdirectory is not used.

Flat files

bundle exec rista build --flat
PathDefaultWith --flat
/index.htmlindex.html
/blogblog/index.htmlblog.html
/blog/2026blog/2026/index.htmlblog/2026.html

Everything else is written the same. Use it for a host that serves blog.html at /blog. The config from rista nginx expects the default layout.

A site in a subdirectory

GitHub reads workflows from .github/workflows at the root of the repository. When the site is in a subdirectory, rista setup writes the workflow to the root and makes its steps run in the site’s directory. The other files stay with the site.

Other CI

The workflows are for GitHub Actions. Elsewhere, install Ruby, the ImageMagick and OpenSSL headers, and run:

bundle install
bundle exec rista build
npx wrangler deploy