Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b73fcce708 | |||
| 48151eaf20 | |||
| 73322831e4 | |||
| bd974ea202 | |||
| 9b03a669c8 | |||
| c813b20215 | |||
| b20e6e2ef0 | |||
| 0565767f3c | |||
| 6c2a8be507 | |||
| d8ce49ba28 |
+35
-24
@@ -1,24 +1,35 @@
|
|||||||
when:
|
when:
|
||||||
branch: main
|
branch: main
|
||||||
event: [push, manual]
|
event: [push, manual]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
install-client:
|
install-client:
|
||||||
image: node:20-alpine
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm ci
|
- cd client && npm install
|
||||||
|
|
||||||
build-client:
|
build-client:
|
||||||
image: node:20-alpine
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm run build
|
- cd client && npm run build
|
||||||
depends_on: [install-client]
|
depends_on: [install-client]
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
volumes:
|
environment:
|
||||||
- /root/.ssh:/root/.ssh:ro
|
DEPLOY_KEY:
|
||||||
commands:
|
from_secret: deploy_key
|
||||||
- apk add --no-cache openssh
|
commands:
|
||||||
- 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'
|
- apk add --no-cache openssh
|
||||||
depends_on: [build-client]
|
- mkdir -p /ssh
|
||||||
|
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
||||||
|
- chmod 600 /ssh/deploy_key
|
||||||
|
- ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no root@192.168.1.80 '
|
||||||
|
cd /opt/min-chat &&
|
||||||
|
git pull origin main &&
|
||||||
|
cd server && npm install --omit=dev && cd .. &&
|
||||||
|
cd client && npm install && npm run build && cd .. &&
|
||||||
|
cp -r client/dist/* /var/www/html/ 2>/dev/null || true &&
|
||||||
|
systemctl restart chat-app
|
||||||
|
'
|
||||||
|
depends_on: [build-client]
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
[
|
[
|
||||||
{ "login": "Danil", "password": "456" },
|
{ "login": "Danil", "password": "456" },
|
||||||
{ "login": "charlie", "password": "789" }
|
{ "login": "Kirill", "password": "123" },
|
||||||
|
{ "login": "Sergiy", "password": "999" }
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user