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