name: Deploy to 110 WOOO Server

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Deploy to 110 over SSH
        uses: appleboy/ssh-action@v1.0.0
        with:
          host: ${{ secrets.SERVER_110_HOST }}
          username: ${{ secrets.SERVER_110_USER }}
          key: ${{ secrets.SERVER_110_SSH_KEY }}
          port: ${{ secrets.SERVER_110_PORT }}
          script: |
            cd /opt/agent-bounty-protocol
            git pull origin main
            docker compose down
            docker compose up -d --build
