Skip to content

refactor:application-dev포트변경 #17

refactor:application-dev포트변경

refactor:application-dev포트변경 #17

Workflow file for this run

name: BabyWithUs CD
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Build with Gradle
env:
MYSQL_DATABASE_URL: ${{ secrets.MYSQL_DATABASE_URL }}
MYSQL_DATABASE_USERNAME: ${{ secrets.MYSQL_DATABASE_USERNAME }}
MYSQL_DATABASE_PASSWORD: ${{ secrets.MYSQL_DATABASE_PASSWORD }}
MYSQL_DATABASE_LOCAL_URL: ${{ secrets.MYSQL_DATABASE_LOCAL_URL }}
PROFILE: ${{ secrets.PROFILE }} # 활성화할 프로파일
run: ./gradlew clean build -Dspring.profiles.active=${{ secrets.PROFILE }}
- name: Stop previous application
uses: appleboy/[email protected]
continue-on-error: true
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: "pkill -f 'BabyWithUs-0.0.1-SNAPSHOT.jar' || true"
- name: Copy files to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
source: "build/libs/*.jar"
target: "/home/ec2-user/BabyWithUs-Back/build/libs/"