forked from Abdulbari/sgeUpdated
Update .gitea/workflows/sgeupdated.yml
This commit is contained in:
@@ -3,14 +3,13 @@ name: sgeUpdated CI/CD
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened # When a new PR is created
|
||||
- closed # When a PR is merged or manually closed
|
||||
- closed # Fires when a PR is closed (either merged or manually closed)
|
||||
branches:
|
||||
- main # The target branch of the PR
|
||||
- main # Only when PR targets main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
if: github.event.pull_request.merged == true || github.event.action == 'opened'
|
||||
if: github.event.pull_request.merged == true # Run only if the PR was merged (not just closed)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -24,7 +23,7 @@ jobs:
|
||||
- name: Run deploy script on server
|
||||
run: |
|
||||
ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF'
|
||||
echo "✅ PR event detected — running deploy script..."
|
||||
echo "✅ PR merged into main — running deploy script..."
|
||||
cd /home/ubuntu/Bgreen/sgeUpdated
|
||||
./deploy.sh
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user