-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
63 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: DEPLOY STAGING | ||
|
||
on: | ||
push: | ||
branches: [ "development" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build with Maven | ||
run: ./mvnw package -DskipTests=true -Dspring-boot.run.profiles=server | ||
|
||
deploy-server-1: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: RUNNING DEPLOY SERVER 1 | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
ls | ||
systemctl status app | ||
sudo systemctl stop app | ||
sudo systemctl status app | ||
echo ================= SERVER 1 STOP APPLICATION SUCCESS ================= | ||
cd app | ||
ls | ||
git checkout development | ||
git pull origin development | ||
echo ================= SERVER 1 PULL SUCCESS ================= | ||
mvn clean install | ||
echo INSTALL SUCCESS | ||
./mvnw package -DskipTests=true | ||
echo ================= SERVER 1 BUILD SUCCESS ================= | ||
sudo mv target/app.jar ~/app-running/app.jar | ||
echo ================= SERVER 1 MOVE APPLICATION SUCCESS ================= | ||
cd ~/app-running && ls | ||
sudo systemctl start app | ||
echo ================= START SUCCESS ================= | ||
sudo systemctl status app | ||
echo ================= SERVER 1 DEPLOYING SUCCESS SERVER 1 ================= | ||
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
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