From 848bb8325601ca73e66f66fb1c17827f7e2e44cf Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 17 Jun 2026 13:28:21 +0000 Subject: [PATCH] feat: add dev pipeline with branch-specific deploy --- .woodpecker.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 79de087..5a555f3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,26 +1,22 @@ when: - branch: main event: [push, manual] steps: install: image: node:20 commands: - - cd client && npm install - + - cd client && npm ci lint: image: node:20 commands: - cd client && npm run lint depends_on: [install] - build: image: node:20 commands: - cd client && npm run build depends_on: [install] - - deploy: + deploy-main: image: alpine:latest environment: DEPLOY_KEY: @@ -28,7 +24,23 @@ steps: commands: - apk add --no-cache openssh rsync - mkdir -p /ssh - - echo "$DEPLOY_KEY" > /ssh/deploy_key + - echo "" > /ssh/deploy_key - chmod 600 /ssh/deploy_key - rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.88:/var/www/ depends_on: [lint, build] + when: + branch: main + deploy-dev: + image: alpine:latest + environment: + DEPLOY_KEY: + from_secret: deploy_key + commands: + - apk add --no-cache openssh rsync + - mkdir -p /ssh + - echo "" > /ssh/deploy_key + - chmod 600 /ssh/deploy_key + - rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.118:/var/www/ + depends_on: [lint, build] + when: + branch: dev