Skip to content
droplet

GitHub Action

LiquidJS Render

v0.0.2 Latest version

LiquidJS Render

droplet

LiquidJS Render

Render LiquidJS using Github Action

Installation

Copy and paste the following snippet into your .yml file.

              

- name: LiquidJS Render

uses: ntsd/liquidjs-action@v0.0.2

Learn more about this action in ntsd/liquidjs-action

Choose a version

LiquidJS Github Action

Name: ntsd/liquidjs-action@main

Github Action to render LiquidJS.

Inputs

variables - The JSON variables to render. required.

template-string - The template string to render. optional.

template-file - The file template to render. optional.

output-file - The rendered out put file. optional.

output-name - The output state name for the result. default result.

Template

This action required template file or template string from input template-file or template-string. The template will render by LiquidJS. You can find the example template file here. The template file will render to file input output-file or Github Action Output name from input output-name.

Examples

Github Action Output render

name: Render LiquidJS
on: push

jobs:
  liquidjs-job:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: LiquidJS Action
        id: run-liquidjs
        uses: ntsd/liquidjs-action@main
        with:
          variables: `{"hello": "Hello LiquidJS"}`
          template-string: "{{ hello }}"
      - name: Echo output
        run: echo "The rendered result is '${{ steps.run-liquidjs.outputs.result }}'"

File render

name: Render LiquidJS
on: push

jobs:
  liquidjs-job:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: LiquidJS Action
        uses: ntsd/liquidjs-action@main
        with:
          variables: `{"hello": "Hello LiquidJS"}`
          template-string: "{{ hello }}"
          output-file: "./RENDER.md"
      - name: Commit files
        run: |
          git config --local user.email "ntsd@users.noreply.github.com"
          git config --local user.name "ntsd"
          git commit -am "docs: auto update RENDER.md"
          git push