Skip to content
/ actions Public

A Github Action for various operations and automation over LikeC4 projects

License

Notifications You must be signed in to change notification settings

likec4/actions

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

LikeC4 Github Action

GitHub release

This action wraps likec4 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

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

Name Description
action Action to perform (build / export / codegen)
export Can be used instead of action: export
codegen Can be used instead of action: codegen, same values as in cli
path Path in repository to likec4 sources, root otherwise
output Output directory/file
base Custom baseUrl for website
use-dot-bin if 'true' will use dot binary of graphviz
use-hash-history use hash history for navigation, e.g. "/#/view" instead of "/view"
webcomponent-prefix same as in cli

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

Report Bugs

Report bugs at https://github.com/likec4/actions/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.