-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,9 @@ jobs: | |
- name: Setup Java JDK | ||
uses: actions/[email protected] | ||
with: | ||
# The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file | ||
java-version: 17 | ||
# Java distribution. See the list of supported distributions in README file | ||
distribution: temurin | ||
# The package type (jdk, jre, jdk+fx, jre+fx) | ||
java-package: jdk | ||
# The architecture of the package (defaults to the action runner's architecture) | ||
architecture: x64 | ||
cache: gradle | ||
|
||
|
@@ -56,41 +52,29 @@ jobs: | |
scp -i private_key.pem -r deploy "${username}@${host}:~" | ||
working-directory: JWT | ||
|
||
- name: Remote SSH Commands | ||
- name: Kill current running Spring process | ||
uses: fifsky/[email protected] | ||
with: | ||
command: | | ||
echo $JAVA_HOME | ||
echo $PATH | ||
java --version | ||
sudo chmod 755 deploy/* | ||
deploy/shutdown.sh | ||
deploy/backup.sh | ||
host: ${{ secrets.EC2_HOST }} | ||
user: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
|
||
- name: Kill current running Spring process | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
script: | | ||
echo $JAVA_HOME | ||
sudo chmod 755 deploy/* | ||
deploy/shutdown.sh | ||
deploy/backup.sh | ||
- name: Send jar file to EC2 | ||
run: | | ||
jarPath=$(./gradlew -q jarPath) | ||
scp -i private_key.pem $jarPath "${username}@${host}:~/server.jar" | ||
working-directory: JWT | ||
|
||
- name: Run new uploaded jar | ||
uses: appleboy/ssh-action@v1.0.3 | ||
uses: fifsky/ssh-action@v0.0.6 | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
script: | | ||
command: | | ||
sudo chmod 755 deploy/* | ||
deploy/startup.sh | ||
host: ${{ secrets.EC2_HOST }} | ||
user: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} |