mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: 'Setup Environment and Build Project'
|
|
description: 'Sets up Node.js with pnpm, installs dependencies, enables Turborepo caching, and builds the project.'
|
|
|
|
inputs:
|
|
node-version:
|
|
description: 'Node.js version to use.'
|
|
required: false
|
|
default: '22.x'
|
|
enable-caching:
|
|
description: Flag to enable/disable all caching (pnpm store, Turborepo, and dist folders).'
|
|
required: false
|
|
default: 'true'
|
|
cache-suffix:
|
|
description: 'Suffix to add to the dist folder cache key.'
|
|
required: false
|
|
default: 'build'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Setup pnpm CLI
|
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
|
|
with:
|
|
run_install: false
|
|
|
|
- name: Setup Node.js
|
|
uses: useblacksmith/setup-node@v5
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
shell: bash
|
|
|
|
- name: Configure Turborepo Cache
|
|
if: inputs.enable-caching == 'true'
|
|
uses: useblacksmith/caching-for-turbo@v1
|
|
|
|
- name: Build packages
|
|
run: pnpm build
|
|
shell: bash
|
|
|
|
- name: Cache 'dist' folders
|
|
if: inputs.enable-caching == 'true'
|
|
uses: useblacksmith/cache@v5
|
|
with:
|
|
path: ./packages/**/dist
|
|
key: ${{ github.sha }}:${{ inputs.cache-suffix }} |