Skip to content

GitHub Actions

GitHub release

This action wraps CLI as a GitHub Action.

Usage

Build website:

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

Tip:
likec4/template repository demonstrates how to deploy to github pages.

Export diagrams to PNG:

---
steps:
- name: export diagrams
uses: likec4/actions@v1
with:
export: png
path: src/likec4
output: images
use-dot-bin: 'true'

Code generation:

---
steps:
- name: code generation
uses: likec4/actions@v1
with:
codegen: react
output: __generated__/likec4.tsx

Inputs

NameDescription
actionAction to perform (build / export / codegen)
exportCan be used instead of action: export
codegenCan be used instead of action: codegen, same values as in cli
pathPath in repository to likec4 sources, root otherwise
outputOutput directory/file
baseCustom baseUrl for website
use-dot-binif 'true' will use dot binary of graphviz

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