-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.71 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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 =================