Skip to content

GitHub Actions

GitHub release

This action wraps LikeC4 CLI as a GitHub Action.

steps:
- uses: actions/checkout@v7
- name: ⚙️ build
uses: likec4/actions@v1
with:
action: build
path: src/likec4
output: dist
base: /baseurl/
- name: upload artifacts
uses: actions/upload-artifact@v7
with:
name: likec4
path: dist

The action also copies index.html to 404.html in the output directory, for single-page app routing on GitHub Pages.

steps:
- name: export diagrams
uses: likec4/actions@v1
with:
export: png
path: src/likec4
output: out/images
use-dot-bin: 'true'
steps:
- name: code generation
uses: likec4/actions@v1
with:
codegen: react
output: __generated__/likec4.jsx
Name Description
action Action to perform: build, export or codegen
export Can be used instead of action: export; png (default) or json
codegen Can be used instead of action: codegen; react (default), webcomponent, ts, dot, d2, mermaid or mmd (see likec4 gen)
path Path in repository to likec4 sources, root otherwise
output Output directory/file
base Custom base URL for the website
use-dot-bin If 'true', uses the dot binary of Graphviz
use-hash-history If 'true', the website uses hash-based navigation, e.g. /#/view instead of /view
webcomponent-prefix Prefix for the generated web components (build and codegen: webcomponent)
likec4-version Version of likec4 to run, e.g. latest (default is the version bundled with the action)

All inputs are optional.
By default the action builds a website to the dist directory.