add deploy pipeline v2
This commit is contained in:
+18
-4
@@ -3,8 +3,22 @@ when:
|
||||
event: [push, manual]
|
||||
|
||||
steps:
|
||||
test-webhook:
|
||||
image: alpine:latest
|
||||
install-client:
|
||||
image: node:20-alpine
|
||||
commands:
|
||||
- echo Hook received successfully!
|
||||
- echo Pipeline works on min-chat
|
||||
- cd client && npm ci
|
||||
|
||||
build-client:
|
||||
image: node:20-alpine
|
||||
commands:
|
||||
- cd client && npm run build
|
||||
depends_on: [install-client]
|
||||
|
||||
deploy:
|
||||
image: alpine:latest
|
||||
volumes:
|
||||
- /root/.ssh:/root/.ssh:ro
|
||||
commands:
|
||||
- apk add --no-cache openssh
|
||||
- ssh -o StrictHostKeyChecking=no -i /root/.ssh/deploy_chat root@192.168.1.80 'cd /opt/min-chat && git pull origin main && cd server && npm install --omit=dev && cd .. && cd client && npm ci && npm run build && cd .. && cp -r client/dist/* /var/www/html/ 2>/dev/null || true && systemctl restart chat-app'
|
||||
depends_on: [build-client]
|
||||
|
||||
Reference in New Issue
Block a user