name: Deploy

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: self-hosted
    steps:
      - name: Pull latest code
        run: git -C /home/reactor/projects/cosmoguard_backend pull

      - name: Install dependencies
        run: /home/reactor/.local/bin/uv sync --frozen --project /home/reactor/projects/cosmoguard_backend

      - name: Restart service
        run: sudo systemctl restart cosmo_api
