FEAT:setup API create order via qr code #44
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
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 ================= | |