Skip to content

Commit 5d14ec5

Browse files
committed
feat: Add CI/CD pipeline for building and deploying SmartCheck AI Engine
1 parent 8d6affd commit 5d14ec5

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI/CD AI Engine Pipeline
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Download code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies and check
21+
run: |
22+
python -m pip install --upgrade pip
23+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
24+
25+
- name: Login into Docker Hub
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
31+
- name: Builds and uploads Docker image
32+
uses: docker/build-push-action@v4
33+
with:
34+
context: .
35+
push: true
36+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/smartcheck-ai-engine:latest
37+
38+
deploy:
39+
needs: build-and-push
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Connects via SSH and Deploys
43+
uses: appleboy/ssh-action@v0.1.10
44+
with:
45+
host: ${{ secrets.SERVER_HOST }}
46+
username: ${{ secrets.SERVER_USER }}
47+
key: ${{ secrets.SERVER_SSH_KEY }}
48+
script: |
49+
cd redcheck-app
50+
sudo docker compose pull smartcheck-ai-engine
51+
sudo docker compose up -d smartcheck-ai-engine

0 commit comments

Comments
 (0)