KiriBuild is a lightweight composite GitHub Action that prepares the toolchain a Kirigami project needs and runs its production export:
- Node 24+ on demand — if the runner already has Node.js 24 or newer, it's left untouched; otherwise the requested version is installed.
- Local CLI first — uses your project's own
kiri(node_modules/.bin/kiri, installed by@kirigami/cli, or by@kirigami/kirigamibefore 3.0.0) when present, and installs@kirigami/cliglobally only when it isn't. - One-command export — runs
kiri exportwith the WebAssembly flag@kirigami/php-wasmrequires.
Checkout, Git LFS, and committing or deploying the exported files are left to your workflow, so you stay in control of what happens around the export.
Published on the GitHub Marketplace — search "KiriBuild" from a workflow file's Actions sidebar, or reference php-kirigami/kiribuild@v2 directly as shown below.
- A workflow that has already checked out the repository (
actions/checkout). - Network access to the npm registry (for the CLI install / project dependencies).
- name: Checkout
uses: actions/checkout@v7
- name: KiriBuild
uses: php-kirigami/kiribuild@v2
with:
node-version: '24'name: Deploy to GitHub Pages
env:
TZ: America/Toronto
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: true
- name: KiriBuild
uses: php-kirigami/kiribuild@v2
with:
node-version: '24'
- name: Commit exported files
shell: bash
run: |
if [ -n "$(git status --porcelain)" ]; then
git config user.name "kirigami[bot]"
git config user.email "[email protected]"
git add -A
git commit -m "chore: update exported files [skip ci]"
git push
else
echo "No changes to commit."
fi
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5- Check for Node 24+ — if the runner already has Node.js 24 or newer, nothing happens.
- Setup Node — only when the check above fails, installs the requested Node.js version (
actions/setup-node@v7). - Install project dependencies — only when a
package.jsonis present, and skipped ifnode_modules/is already there. Usesnpm ciwhen apackage-lock.json(ornpm-shrinkwrap.json) is committed — so a checked-in lockfile is never rewritten by the build — and falls back tonpm installotherwise. - Ensure the Kirigami CLI is available — if
node_modules/.bin/kiriexists it's used as-is; otherwise@kirigami/cliis installed globally sokiriis always onPATH(or@kirigami/kirigami, when the legacykirigami-versioninput is set). A project that depends on@kirigami/kirigamiwithout@kirigami/cligets a warning: the globalkirithen runs its own engine version rather than the project's. - Export — runs
kiri export(adding the--experimental-wasm-jspiNode flag on Node versions that still need it, i.e. Node 24), preferring the project's localkiribinary over the global one.
| Name | Description | Required | Default |
|---|---|---|---|
node-version |
Node.js version to install if the runner does not already have Node 24+ | false | 24 |
cli-version |
Version of @kirigami/cli to install globally when the project has no local kiri |
false | latest |
kirigami-version |
Legacy: install this @kirigami/kirigami version globally instead of @kirigami/cli. Only versions before 3.0.0 ship kiri |
false | (empty) |
Since @kirigami/kirigami 3.0.0, the kiri command lives in @kirigami/cli. The recommended setup is to add @kirigami/cli to the project's devDependencies, so the action uses the locally pinned CLI.
This action has no outputs. Artifact upload, commits, and deployment are left to your own workflow, so you stay in control of what happens to the exported files.
.github/workflows/test.yml has two jobs, both on every push / PR:
cli-resolution— runs the tiny fixture intest/fixtures/sitethrough every CLI-resolution branch (local-cli,local-cli-package,global-cli,preinstalled,lockfile,has-node-24,pinned-version, plus a non-blockinglatest-canary), and checks the core Kirigami feature surface on each: layouts, a data file, a Markdown block, a custom tag + render hook, and the image autogenerator.templates— runs the action against the officialtemplate-defaultandtemplate-demo, covering the@kirigami/canvaSass pipeline, esbuild and the highlight plugin.
Run them locally with act:
act push -j cli-resolution
act push -j templatesThis project is distributed under the MIT license.
MIT © Maxime Larrivée-Roy, 2026