25 lines
738 B
YAML
25 lines
738 B
YAML
when:
|
|
branch: main
|
|
event: [push, manual]
|
|
|
|
steps:
|
|
install-client:
|
|
image: node:20-alpine
|
|
commands:
|
|
- 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]
|