name: Deploy Golang App on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - name: Set up SSH key uses: webfactory/ssh-agent@v0.5.4 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Deploy to VPS run: | ssh -o StrictHostKeyChecking=no qobiltu@103.23.199.136 << 'EOF' cd /home/qobiltu/api-qobiltu git pull origin main docker-compose down -v docker-compose up --build -d docker image prune -f EOF