Some checks failed
Deploy Smart Search Backend / deploy (push) Failing after 21s
38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
name: Deploy Smart Search Backend
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: docker
|
|
container:
|
|
image: docker:latest
|
|
options: --privileged
|
|
steps:
|
|
- 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 /app
|
|
docker pull golang:1.23-alpine || true
|
|
docker pull alpine:latest || true
|
|
docker build -t smart-search-backend:latest .
|
|
|
|
- name: Deploy to server
|
|
run: |
|
|
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: Done
|
|
run: echo "✅ Backend deployed!"
|