Files
ci/setup-node/action.yml
T
ozan 1564c61acc fix: Alpine compatibility + READMEs + roadmap
- setup-node: detect Alpine/Debian, use apk or NodeSource
- setup-aws: use pip on Alpine (musl), binary on Debian (glibc)
- setup-go: fix version parsing for Alpine (no grep -P)
- README per action with usage examples and input docs
- PLAN.md: roadmap for runner images, labels, Lambda dispatch
2026-05-22 18:06:11 +01:00

58 lines
1.7 KiB
YAML

# tinqs/ci/setup-node — Tinqs Studio CI
# Installs Node.js and optionally pnpm.
# Detects Alpine vs Debian and uses the right package manager.
# 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'
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 | sed 's/v//' | cut -d. -f1)
if [ "$CURRENT" = "$NODE_VERSION" ]; then
echo "Node $NODE_VERSION already installed"
node --version
if [ "$INSTALL_PNPM" = "true" ] && command -v pnpm &>/dev/null; then
pnpm --version
exit 0
fi
fi
fi
echo "Installing Node.js $NODE_VERSION..."
if command -v apk &>/dev/null; then
# Alpine
apk add --no-cache nodejs npm
elif command -v apt-get &>/dev/null; then
# Debian/Ubuntu
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash -
apt-get install -y nodejs
else
echo "ERROR: unsupported package manager" && exit 1
fi
if [ "$INSTALL_PNPM" = "true" ]; then
npm install -g pnpm
pnpm --version
fi
node --version
shell: bash