This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
name: Deploy Smart Search Backend Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- test
|
||||
|
||||
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 --branch test https://git.techease.ru/Smart-search/smart-search-back.git /app && cd /app
|
||||
|
||||
- name: Login to Docker Hub
|
||||
run: |
|
||||
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
cd /app
|
||||
docker build -t smart-search-backend-test:latest .
|
||||
|
||||
- name: Deploy to test server
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H test-1xc5f.techease.ru >> ~/.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'
|
||||
|
||||
- name: Done
|
||||
run: echo "✅ Test backend deployed!"
|
||||
Reference in New Issue
Block a user