From 8d3b9018bc512c3a3713734c423351f74889d630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=97=AC=EC=A7=84?= <84865066+LUCETE012@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:48:07 +0900 Subject: [PATCH 1/2] Create deploy.yml --- ".github/workflows/\bdeploy.yml" | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 ".github/workflows/\bdeploy.yml" diff --git "a/.github/workflows/\bdeploy.yml" "b/.github/workflows/\bdeploy.yml" new file mode 100644 index 0000000..c4fad8b --- /dev/null +++ "b/.github/workflows/\bdeploy.yml" @@ -0,0 +1,53 @@ +name: CI/CD Pipeline for Spring Boot with Gradle + +on: + push: + branches: + - main # 또는 배포하려는 브랜치 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew build + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: spring-boot-app + path: build/libs/*.jar # Gradle의 빌드 아웃풋 경로 + + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + name: spring-boot-app + + - name: Deploy to EC2 + uses: appleboy/ssh-action@v0.1.6 + with: + host: ${{ secrets.EC2_HOST }} + username: ec2-user + key: ${{ secrets.SSH_PRIVATE_KEY }} # SSH 접근을 위한 개인 키 + script: | + sudo pkill -f 'java -jar' || true # 기존 Java 프로세스 종료 + sudo rm -rf /home/ec2-user/app/* # 이전 빌드 파일 삭제 + sudo mv *.jar /home/ec2-user/app/app.jar # 새 파일 이동 + sudo nohup java -jar /home/ec2-user/app/app.jar > /home/ec2-user/app/app.log 2>&1 & # 새 애플리케이션 실행 From f679176e2a6f6ab3f6f4323faf3497973f0ad100 Mon Sep 17 00:00:00 2001 From: MinSeok Chang Date: Fri, 4 Oct 2024 16:52:28 +0900 Subject: [PATCH 2/2] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..37f4f50 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 새천년건강체조 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.