Skip to content

Commit

Permalink
ci: auto deploy only in master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Sep 15, 2024
1 parent 83e95cc commit c8a355b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Get Time
id: time
uses: nanzm/[email protected]
if: github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
with:
timeZone: 8
format: 'YYYY/MM/DD-HH:mm:ss'
Expand All @@ -96,6 +96,7 @@ jobs:
# Copy jar to test server
- name: Copy Jar to Test Server
uses: appleboy/scp-action@master
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
with:
host: ${{ secrets.TEST_SERVER_HOST }}
username: ${{ secrets.TEST_SERVER_USER_NAME }}
Expand All @@ -107,6 +108,7 @@ jobs:
# Restart test server
- name: Restart Test Server
uses: appleboy/ssh-action@master
if: success() && github.event_name == 'push' && github.repository == 'AllayMC/Allay' && contains(github.ref_name, 'master')
with:
host: ${{ secrets.TEST_SERVER_HOST }}
username: ${{ secrets.TEST_SERVER_USER_NAME }}
Expand Down

0 comments on commit c8a355b

Please sign in to comment.