feat: add dev pipeline with branch-specific deploy

This commit is contained in:
2026-06-17 13:27:27 +00:00
parent 5fd45dd0c2
commit 9cc89908d6
+19 -3
View File
@@ -1,12 +1,11 @@
when:
branch: main
event: [push, manual]
steps:
install:
image: node:20
commands:
- cd client && npm install
- cd client && npm ci
lint:
image: node:20
@@ -20,7 +19,7 @@ steps:
- cd client && npm run build
depends_on: [install]
deploy:
deploy-main:
image: alpine:latest
environment:
DEPLOY_KEY:
@@ -32,3 +31,20 @@ steps:
- 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 "$DEPLOY_KEY" > /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