Skip to content

Commit 4fdf6d4

Browse files
committed
chore: Add GitHub Actions workflow for production deployment
1 parent e0839d4 commit 4fdf6d4

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deploy to Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
name: Build & Deploy on server
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Deploy via SSH
15+
uses: appleboy/ssh-action@v1.2.0
16+
with:
17+
host: ${{ secrets.SSH_HOST }}
18+
username: ${{ secrets.SSH_USER }}
19+
key: ${{ secrets.SSH_PRIVATE_KEY }}
20+
script: |
21+
set -e
22+
cd /opt/assistant-chat-backend
23+
git pull origin main
24+
docker compose build --no-cache
25+
docker compose down --remove-orphans
26+
docker compose up -d
27+
docker image prune -af

0 commit comments

Comments
 (0)