Files
dify/.github/actions/setup-web/action.yml

38 lines
1.3 KiB
YAML

name: Setup Web Environment
description: Set up Node.js, Vite+, pnpm, and web dependencies
inputs:
run-install:
description: Install web dependencies after setting up the toolchain
default: 'true'
cache-save:
description: Save the dependency cache after the job completes
default: 'true'
runs:
using: composite
steps:
# setup-node resolves engines.node from the runner tool cache or GitHub's mirror.
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: package.json
package-manager-cache: false
# pnpm/setup also restores pnpm's lockfile verification log; without it every job
# re-checks the whole lockfile against the registry before installing.
- name: Setup pnpm
uses: pnpm/setup@a0881977cd8ea73b1ed212236c99ca10dcc80cf4 # v3.1.1
with:
install: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@3754dd7dbdb32bd8f6d28b6043de13ad3a75f21f # v1.21.1
with:
node-manager: false
package-manager: |
pnpm: false
npm: false
cache: true
# Nested composite post actions can evaluate inputs in the outer scope.
cache-save: ${{ inputs.cache-save || 'true' }}
run-install: ${{ inputs.run-install }}