From 4761850502430169f426010ab95cfd96f212de9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Mon, 30 Mar 2026 11:41:07 +0800 Subject: [PATCH] ci: switch to node:20-slim and fix YAML indentation Fix CI failure caused by YAML indentation issues and missing SSH client. Changes: 1. Fix YAML indentation for build-and-deploy step 2. Switch from node:20-alpine to node:20-slim 3. Update SSH installation commands for Debian-based system 4. Add SSH client availability check Benefits: - node:20-slim may already include SSH client - If not, uses apt-get instead of apk for installation - Better compatibility with deployment tools This should resolve the 'No pipeline steps available!' error. --- .woodpecker.yml | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 7737b5f..22d9f94 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,5 @@ variables: - - &node_image node:20-alpine + - &node_image node:20-slim steps: install-deps: @@ -112,29 +112,30 @@ steps: - dev build-and-deploy: - image: node:20-alpine - environment: - NODE_ENV: production - NEXT_TELEMETRY_DISABLED: 1 - SSH_PRIVATE_KEY: - from_secret: ssh_private_key - depends_on: - - install-deps - - lint - - type-check - commands: - - echo "Installing SSH client" - - apk add --no-cache openssh-client rsync - - echo "Building production artifacts" - - npm run build - - echo "Build completed" - - ls -la dist/ - - echo "Deploying to production" - - mkdir -p ~/.ssh - - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - echo "Pre-deployment checks" - - ssh root@139.155.109.62 "echo 'Server connection OK'" + image: *node_image + environment: + NODE_ENV: production + NEXT_TELEMETRY_DISABLED: 1 + SSH_PRIVATE_KEY: + from_secret: ssh_private_key + depends_on: + - install-deps + - lint + - type-check + commands: + - echo "Checking SSH client availability" + - which ssh && echo "SSH client found" || echo "Installing SSH client" + - apt-get update && apt-get install -y openssh-client rsync + - echo "Building production artifacts" + - npm run build + - echo "Build completed" + - ls -la dist/ + - echo "Deploying to production" + - mkdir -p ~/.ssh + - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - echo "Pre-deployment checks" + - ssh root@139.155.109.62 "echo 'Server connection OK'" - ssh root@139.155.109.62 "df -h | grep -E '/$|/home'" - echo "Syncing build artifacts to production server" - rsync -avz --delete dist/ root@139.155.109.62:/home/novalon/docker-app/novalon-website/dist/