From 93cad886d6a33f0da988ae33be35b20dc00c7169 Mon Sep 17 00:00:00 2001 From: Abdulbari Date: Thu, 30 Oct 2025 19:20:19 +0300 Subject: [PATCH] Update .gitea/workflows/sgeupdated.yml --- .gitea/workflows/sgeupdated.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/sgeupdated.yml b/.gitea/workflows/sgeupdated.yml index f3de55e..3c93790 100644 --- a/.gitea/workflows/sgeupdated.yml +++ b/.gitea/workflows/sgeupdated.yml @@ -2,11 +2,14 @@ name: sgeUpdated CI/CD on: pull_request: + types: + - closed # Trigger when PR is closed (merged or manually closed) branches: - - main - + - main # Target branch where PRs are merged into + jobs: deploy: + if: github.event.pull_request.merged == true # Run only if the PR was merged, not just closed runs-on: ubuntu-latest steps: @@ -20,7 +23,7 @@ jobs: - name: Run deploy script on server run: | ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF' - echo "✅ Connected to server. Running deploy script..." + echo "✅ Pull request merged — running deploy script..." cd /home/ubuntu/Bgreen/sgeUpdated ./deploy.sh EOF