add deploy pipeline v2
This commit is contained in:
+18
-4
@@ -3,8 +3,22 @@ when:
|
|||||||
event: [push, manual]
|
event: [push, manual]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
test-webhook:
|
install-client:
|
||||||
image: alpine:latest
|
image: node:20-alpine
|
||||||
commands:
|
commands:
|
||||||
- echo Hook received successfully!
|
- cd client && npm ci
|
||||||
- echo Pipeline works on min-chat
|
|
||||||
|
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