фикс
Some checks failed
Deploy Smart Search Backend / deploy (push) Failing after 15s

This commit is contained in:
2026-01-17 17:22:50 +00:00
parent de23bd3d9a
commit 54bf77e545

View File

@@ -8,31 +8,28 @@ on:
jobs:
deploy:
runs-on: docker
container:
image: docker:latest
options: --privileged
steps:
- name: Clone repository
run: |
cd /tmp
rm -rf smart-search-back || true
git clone --depth 1 --branch main https://git.techease.ru/Smart-search/smart-search-back.git
- name: Install git
run: apk add --no-cache git openssh-client
- name: Checkout code
run: git clone --depth 1 https://git.techease.ru/Smart-search/smart-search-back.git /app && cd /app
- name: Build Docker image
run: |
cd /tmp/smart-search-back
cd /app
docker build -t smart-search-backend:latest .
- name: Stop old container
- name: Deploy to server
run: |
docker stop smart-search-backend || true
docker rm smart-search-backend || true
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 185.185.142.203 >> ~/.ssh/known_hosts 2>/dev/null || true
ssh -i ~/.ssh/id_rsa root@185.185.142.203 'cd /home/n8n && docker-compose up -d'
- name: Run new container
run: |
docker run -d \
--name smart-search-backend \
--restart always \
-p 127.0.0.1:9091:9091 \
smart-search-backend:latest
- name: Cleanup
run: |
docker image prune -f
- name: Done
run: echo "✅ Backend deployed!"