Compare commits
8 Commits
b73fcce708
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3180d799fa | |||
| 3ab549f5b7 | |||
| 6f922f16a1 | |||
| c585abab8e | |||
| 7b2e46f1c5 | |||
| 8de49b5391 | |||
| 23a06ed008 | |||
| 6d715abe4d |
+30
-35
@@ -1,35 +1,30 @@
|
|||||||
when:
|
when:
|
||||||
branch: main
|
branch: main
|
||||||
event: [push, manual]
|
event: [push, manual]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
install-client:
|
install:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm install
|
- cd client && npm install
|
||||||
|
|
||||||
build-client:
|
build:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd client && npm run build
|
- cd client && npm run build
|
||||||
depends_on: [install-client]
|
depends_on: [install]
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
environment:
|
environment:
|
||||||
DEPLOY_KEY:
|
DEPLOY_KEY:
|
||||||
from_secret: deploy_key
|
from_secret: deploy_key
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache openssh
|
- apk add --no-cache openssh rsync
|
||||||
- mkdir -p /ssh
|
- mkdir -p /ssh
|
||||||
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
- echo "$DEPLOY_KEY" > /ssh/deploy_key
|
||||||
- chmod 600 /ssh/deploy_key
|
- chmod 600 /ssh/deploy_key
|
||||||
- ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no root@192.168.1.80 '
|
- 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 /opt/min-chat &&
|
- rsync -e "ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no" -avz --delete client/dist/ root@192.168.1.80:/var/www/html/
|
||||||
git pull origin main &&
|
- ssh -i /ssh/deploy_key -o StrictHostKeyChecking=no root@192.168.1.80 'systemctl restart chat-app'
|
||||||
cd server && npm install --omit=dev && cd .. &&
|
depends_on: [build]
|
||||||
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]
|
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
[
|
[
|
||||||
{ "login": "Danil", "password": "456" },
|
{ "login": "Danil", "password": "456" },
|
||||||
{ "login": "Kirill", "password": "123" },
|
{ "login": "Kirill", "password": "123" }
|
||||||
{ "login": "Sergiy", "password": "999" }
|
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user