name: Deploy Portal API on: push: branches: - production workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy uses: appleboy/ssh-action with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} key: ${{ secrets.SSH_PRIVATE_KEY }} port: ${{ secrets.PORT }} script_stop: true script: | set -e cd ~/httpdocs echo "==> Pulling latest code..." git fetch origin production git reset --hard origin/production echo "==> Running migrations..." php artisan migrate --force echo "==> Optimizing Laravel..." php artisan optimize echo "==> Deploy completed!"