Files
ci/setup-node/action.yml
T

46 lines
1.4 KiB
YAML

# tinqs/ci/setup-node — Tinqs Studio CI
# Installs Node.js via NodeSource and optionally pnpm.
# Skips install if the correct major version is already present (pre-baked runner image).
# Composite action — runs directly on the host.
# Author: Ozan + Claude Code — 2026-05-22
name: 'Tinqs Setup Node'
description: 'Install Node.js and pnpm (replaces actions/setup-node)'
inputs:
node-version:
description: 'Node.js major version'
default: '22'
pnpm:
description: 'Install pnpm (true/false)'
default: 'true'
runs:
using: 'composite'
steps:
- run: |
NODE_VERSION="${{ inputs.node-version }}"
INSTALL_PNPM="${{ inputs.pnpm }}"
# Skip if already installed at correct major version
if command -v node &>/dev/null; then
CURRENT=$(node --version | grep -oP '\d+' | head -1)
if [ "$CURRENT" = "$NODE_VERSION" ]; then
echo "Node $NODE_VERSION already installed"
node --version
[ "$INSTALL_PNPM" = "true" ] && command -v pnpm &>/dev/null && pnpm --version && exit 0
fi
fi
echo "Installing Node.js $NODE_VERSION..."
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash -
apt-get install -y nodejs
if [ "$INSTALL_PNPM" = "true" ]; then
npm install -g pnpm
pnpm --version
fi
node --version
shell: bash