tinqs/ci — composite actions + Lambda dispatcher for Spot CI runners
Actions: checkout, setup-go, setup-node, setup-aws Dispatcher: Lambda → EC2 Spot (ephemeral, self-terminating) Images: base, go, node, docker, deploy, godot Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# tinqs/ci/setup-node
|
||||
|
||||
Installs Node.js and optionally pnpm.
|
||||
|
||||
Detects Alpine vs Debian and uses the right package manager (`apk` or NodeSource). Skips installation if the correct major version is already present in the runner image.
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
- uses: tinqs/ci/setup-node@v1
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```yaml
|
||||
- uses: tinqs/ci/setup-node@v1
|
||||
with:
|
||||
node-version: '22' # default: 22
|
||||
pnpm: 'true' # default: true
|
||||
```
|
||||
|
||||
## Inputs
|
||||
|
||||
| Input | Default | Description |
|
||||
|-------|---------|-------------|
|
||||
| `node-version` | `22` | Node.js major version |
|
||||
| `pnpm` | `true` | Install pnpm globally |
|
||||
@@ -0,0 +1,68 @@
|
||||
# tinqs/ci/setup-node — Tinqs Studio CI
|
||||
# Installs Node.js and optionally pnpm.
|
||||
# Detects Alpine (apk), Debian (apt-get), and Amazon Linux/RHEL (dnf).
|
||||
# Skips install if the correct major version is already present (pre-baked AMI).
|
||||
# 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" ]; then
|
||||
if command -v pnpm &>/dev/null; then
|
||||
pnpm --version
|
||||
exit 0
|
||||
else
|
||||
npm install -g pnpm
|
||||
pnpm --version
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
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 dnf &>/dev/null; then
|
||||
# Amazon Linux / RHEL / Fedora
|
||||
curl -fsSL "https://rpm.nodesource.com/setup_${NODE_VERSION}.x" | bash -
|
||||
dnf install -y nodejs
|
||||
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
|
||||
Reference in New Issue
Block a user