name: "install frontend" | |
description: "Install frontend deps" | |
inputs: | |
skip_build: | |
description: "Skip build" | |
default: "false" | |
build_lite: | |
description: "Build lite" | |
default: "false" | |
runs: | |
using: "composite" | |
steps: | |
# - uses: actions/cache@v4 | |
# id: frontend-cache | |
# with: | |
# path: | | |
# gradio/templates/* | |
# key: gradio-lib-front-end-${{ hashFiles('js/**', 'client/js/**')}} | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # @v4 | |
with: | |
version: 9.1.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: pnpm | |
cache-dependency-path: pnpm-lock.yaml | |
- name: Install deps | |
shell: bash | |
run: pnpm i --frozen-lockfile --ignore-scripts | |
- name: Build Css | |
shell: bash | |
run: pnpm css | |
- name: Build frontend | |
if: inputs.skip_build == 'false' | |
# && steps.frontend-cache.outputs.cache-hit != 'true' | |
shell: bash | |
run: pnpm build | |
- name: generate types | |
if: inputs.skip_build == 'false' || inputs.build_lite == 'true' | |
shell: bash | |
run: pnpm package | |
- name: Build frontend lite | |
if: inputs.build_lite == 'true' | |
shell: bash | |
run: | | |
. venv/bin/activate | |
python -m pip install -U build hatch packaging>=23.2 # packaging>=23.2 is needed to build Lite due to https://github.com/pypa/hatch/issues/1381 | |
pnpm build:lite | |