From a314b5c370ceecf48c9ab5aa444c4c7f486af7fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Mon, 30 Mar 2026 11:31:56 +0800 Subject: [PATCH] ci: install SSH client in Alpine Linux for deployment Fix CI failure caused by missing SSH client in node:20-alpine image. Problem: - Alpine Linux doesn't include SSH client by default - This caused CI to fail with '/bin/sh: ssh: not found' Solution: - Install openssh-client and rsync packages using apk - This enables SSH connections to production server This should resolve the final CI failure and allow successful deployment. --- .woodpecker.yml | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 5c5dec5..7737b5f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -112,27 +112,29 @@ steps: - dev build-and-deploy: - 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 "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: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'" - 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/