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,28 @@
|
||||
# tinqs/ci/setup-aws
|
||||
|
||||
Installs AWS CLI and optionally logs into ECR.
|
||||
|
||||
Detects Alpine (musl) vs Debian (glibc) and uses the right install method — pip on Alpine, official binary on Debian. Credentials come from the runner environment (IAM task role on Fargate, instance profile on EC2).
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
- uses: tinqs/ci/setup-aws@v1
|
||||
```
|
||||
|
||||
### With ECR login
|
||||
|
||||
```yaml
|
||||
- uses: tinqs/ci/setup-aws@v1
|
||||
with:
|
||||
ecr-login: 'true'
|
||||
ecr-repo: '149751500842.dkr.ecr.eu-west-1.amazonaws.com/tinqs-git'
|
||||
```
|
||||
|
||||
## Inputs
|
||||
|
||||
| Input | Default | Description |
|
||||
|-------|---------|-------------|
|
||||
| `region` | `eu-west-1` | AWS region |
|
||||
| `ecr-login` | `false` | Login to ECR after install |
|
||||
| `ecr-repo` | `` | ECR repository URL (required when ecr-login is true) |
|
||||
@@ -0,0 +1,59 @@
|
||||
# tinqs/ci/setup-aws — Tinqs Studio CI
|
||||
# Installs AWS CLI and optionally logs into ECR.
|
||||
# Detects Alpine (apk/pip), Debian (apt-get), and Amazon Linux/RHEL (dnf).
|
||||
# Skips install if AWS CLI is already present (pre-baked AMI).
|
||||
# Credentials come from the runner environment (IAM instance profile on EC2,
|
||||
# task role on Fargate) — no explicit key configuration needed.
|
||||
# Composite action — runs directly on the host.
|
||||
# Author: Ozan + Claude Code — 2026-05-22
|
||||
|
||||
name: 'Tinqs Setup AWS'
|
||||
description: 'Install AWS CLI and optionally login to ECR'
|
||||
|
||||
inputs:
|
||||
region:
|
||||
description: 'AWS region'
|
||||
default: 'eu-west-1'
|
||||
ecr-login:
|
||||
description: 'Login to ECR (true/false)'
|
||||
default: 'false'
|
||||
ecr-repo:
|
||||
description: 'ECR repository URL (required if ecr-login is true)'
|
||||
default: ''
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- run: |
|
||||
REGION="${{ inputs.region }}"
|
||||
ECR_LOGIN="${{ inputs.ecr-login }}"
|
||||
ECR_REPO="${{ inputs.ecr-repo }}"
|
||||
|
||||
# Install AWS CLI if missing
|
||||
if ! command -v aws &>/dev/null; then
|
||||
echo "Installing AWS CLI..."
|
||||
if command -v apk &>/dev/null; then
|
||||
# Alpine — use pip (AWS CLI v2 binary needs glibc)
|
||||
apk add --no-cache python3 py3-pip
|
||||
pip3 install --break-system-packages awscli 2>/dev/null || pip3 install awscli
|
||||
elif command -v dnf &>/dev/null || command -v apt-get &>/dev/null; then
|
||||
# Amazon Linux / Debian — official installer (glibc available)
|
||||
curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o /tmp/awscli.zip
|
||||
unzip -q /tmp/awscli.zip -d /tmp/aws-install
|
||||
/tmp/aws-install/aws/install
|
||||
rm -rf /tmp/awscli.zip /tmp/aws-install
|
||||
else
|
||||
echo "ERROR: unsupported package manager" && exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
aws --version
|
||||
|
||||
# ECR login
|
||||
if [ "$ECR_LOGIN" = "true" ] && [ -n "$ECR_REPO" ]; then
|
||||
echo "Logging into ECR ($REGION)..."
|
||||
aws ecr get-login-password --region "$REGION" | \
|
||||
docker login --username AWS --password-stdin "$ECR_REPO"
|
||||
echo "ECR login OK"
|
||||
fi
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user