This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
name: Deploy Smart Search Backend Test
|
name: Deploy Smart Search Backend
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- test
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
run: apk add --no-cache git openssh-client
|
run: apk add --no-cache git openssh-client
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
run: git clone --depth 1 --branch test https://git.techease.ru/Smart-search/smart-search-back.git /app && cd /app
|
run: git clone --depth 1 https://git.techease.ru/Smart-search/smart-search-back.git /app && cd /app
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
run: |
|
run: |
|
||||||
@@ -25,15 +25,15 @@ jobs:
|
|||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
cd /app
|
cd /app
|
||||||
docker build -t smart-search-backend-test:latest .
|
docker build -t smart-search-backend:latest .
|
||||||
|
|
||||||
- name: Deploy to test server
|
- name: Deploy to server
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
|
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan -H test-1xc5f.techease.ru >> ~/.ssh/known_hosts 2>/dev/null || true
|
ssh-keyscan -H 185.185.142.203 >> ~/.ssh/known_hosts 2>/dev/null || true
|
||||||
ssh -i ~/.ssh/id_rsa root@test-1xc5f.techease.ru 'cd /home/n8n && /usr/bin/docker compose up -d smart-search-backend'
|
ssh -i ~/.ssh/id_rsa root@185.185.142.203 'cd /home/n8n && /usr/bin/docker compose up -d smart-search-backend'
|
||||||
|
|
||||||
- name: Done
|
- name: Done
|
||||||
run: echo "✅ Test backend deployed!"
|
run: echo "✅ Backend deployed!"
|
||||||
Reference in New Issue
Block a user