Skip to content

Merge pull request #123 from Delta-Docs/deployment/cicd #11

Merge pull request #123 from Delta-Docs/deployment/cicd

Merge pull request #123 from Delta-Docs/deployment/cicd #11

Workflow file for this run

name: Deploy to VPS
on:
push:
branches: [ "main" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_IP }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_SSH_KEY }}
script: |
# 1. Enter the project folder
cd delta.backend
# 2. Pull the latest code
git pull origin main
# 3. Build and run updated containers
sudo docker-compose up --build -d
# 4. Migrate the DB
sudo docker-compose exec -T api alembic upgrade head