Skip to content

Commit

Permalink
Merge pull request #5 from KORAD1004/feature/course
Browse files Browse the repository at this point in the history
✨Feat: 테마별 추천코스
  • Loading branch information
Jindongleee authored Sep 28, 2024
2 parents 1855204 + 5eaff00 commit edb7651
Show file tree
Hide file tree
Showing 11 changed files with 677 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CD with Gradle

on:
push:
branches:
- main # main 브랜치에 push될 때
- develop # develop 브랜치에 push될 때

permissions: write-all # 테스트 결과 작성을 위해 쓰기권한 추가

jobs:
build:
if: github.event.pull_request.merged == true || github.event_name == 'push' # PR merge 또는 push일 때 실행
runs-on: ubuntu-latest # 환경
steps:
- name: Checkout repository
uses: actions/checkout@v3 # 코드 체크아웃 = 가상환경 복사

- name: Set up JDK 17
uses: actions/setup-java@v3 #jdk 컴파일러
with:
java-version: '17'
distribution: 'temurin' # 자바 개발 키트 배포판

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test #빌드

- name: Ensure target directory exists
uses: appleboy/ssh-action@master # SSH를 통해 대상 디렉토리 생성
with:
username: ubuntu
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
script: |
mkdir -p /home/ubuntu/nuclear_server
- name: List build directory
run: ls -la build/libs

- name: Transfer Build File using SCP
uses: appleboy/scp-action@master # .jar 파일 원격 서버로 복사
with:
username: ubuntu
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
source: |
build/libs/back_end-0.0.1-SNAPSHOT.jar
target: "/home/ubuntu/nuclear_server"

- name: Deploy using Docker Compose via SSH(Prod)
if: github.ref == 'refs/heads/main'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
key: ${{ secrets.SSH_KEY }}
script_stop: true
script: |
cd /home/ubuntu/nuclear_server || exit 1 # 경로 변경 실패 시 종료
sudo docker compose --profile prod --env-file .env.prod down
sudo docker compose --profile prod --env-file .env.prod up --build -d
- name: Deploy using Docker Compose via SSH(Dev)
if: github.ref == 'refs/heads/develop'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ubuntu
key: ${{ secrets.SSH_KEY }}
script_stop: true
script: |
cd /home/ubuntu/nuclear_server || exit 1 # 경로 변경 실패 시 종료
sudo docker compose --profile dev --env-file .env.dev down
sudo docker compose --profile dev --env-file .env.dev up --build -d
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
.yml
152 changes: 152 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# nuclear-backend

Tag Name: Description 👋

git Commit Convention

🎉Start: Start New Project

✨Feat: 새로운 기능을 추가

🐛Fix: 버그 수정

🎨Design: CSS 등 사용자 UI 디자인 변경

🚨BREAKING CHANGE: 커다란 API 변경의 경우

🚑HOTFIX: 급하게 치명적인 버그를 고쳐야하는 경우

♻️Refactor: 코드 리팩토링

⚙️Settings: Changing configuration files

🗃️Comment: 필요한 주석 추가 및 변경

📝Docs: 문서 수정

💻Test: 테스트 코드, 리펙토링 테스트 코드 추가, Production Code(실제로 사용하는 코드) 변경 없음

🔧Chore: 빌드 업무 수정, 패키지 매니저 수정, 패키지 관리자 구성 등 업데이트, Production Code 변경 없음

🚀Deploy: Deploying stuff

🔄️Rename: 파일 혹은 폴더명을 수정하거나 옮기는 작업만인 경우

🪚Remove: 파일을 삭제하는 작업만 수행한 경우

💡 PR Convention

아이콘 코드 설명
🎨 :art Improve structure / format of the code.

🎉 :tada Begin a project.

⚡️ :zap Improve performance.

🔥 :fire Remove code or files.

🐛 :bug Fix a bug.

🚑️ :ambulance Critical hotfix.

:sparkles Introduce new features.

📝 :memo Add or update documentation.

🚀 :rocket Deploy stuff.

💄 :lipstick Add or update the UI and style files.

:white_check_mark Add, update, or pass tests.

🔒️ :lock Fix security or privacy issues.

🔐 :closed_lock_with_key Add or update secrets.

🔖 :bookmark Release / Version tags.

🚨 :rotating_light Fix compiler / linter warnings.

🚧 :construction Work in progress.

💚 :green_heart Fix CI Build.

⬇️ :arrow_down Downgrade dependencies.

⬆️ :arrow_up Upgrade dependencies.

📌 :pushpin Pin dependencies to specific versions.

📈 :chart_with_upwards_trend Add or update analytics or track code.

♻️ :recycle Refactor code.

:heavy_plus_sign Add a dependency.

:heavy_minus_sign Remove a dependency.

🔧 :wrench Add or update configuration files.

🔨 :hammer Add or update development scripts.

✏️ :pencil2 Fix typos.

💩 :poop Write bad code that needs to be improved.

⏪️ :rewind Revert changes.

🔀 :twisted_rightwards_arrows Merge branches.

📦️ :package Add or update compiled files or packages.

👽️ :alien Update code due to external API changes.

🚚 :truck Move or rename resources.

📄 :page_facing_up Add or update license.

💥 :boom Introduce breaking changes.

🍱 :bento Add or update assets.

♿️ :wheelchair Improve accessibility.

💡 :bulb Add or update comments in source code.

💬 :speech_balloon Add or update text and literals.

🗃️ :card_file_box Perform database related changes.

🔊 :loud_sound Add or update logs.

🔇 :mute Remove logs.

👥 :busts_in_silhouette Add or update contributor(s).

🚸 :children_crossing Improve user experience / usability.

🏗️ :building_construction Make architectural changes.

📱 :iphone Work on responsive design.

🥚 :egg Add or update an easter egg.

🙈 :see_no_evil Add or update a .gitignore file.

📸 :camera_flash Add or update snapshots.

⚗️ :alembic Perform experiments.

🔍️ :mag Improve SEO.

🏷️ :label Add or update types.

🌱 :seedling Add or update seed files.

🚩 :triangular_flag_on_post Add, update, or remove feature flags.

🥅 :goal_net Catch errors.

💫 :dizzy Add or update animations and transitions.

🗑️ :wastebasket Deprecate code that needs to be cleaned up.
43 changes: 43 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.4'
id 'io.spring.dependency-management' version '1.1.6'
id 'com.diffplug.spotless' version '6.11.0'
}

group = 'com.korad1004'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'

}

tasks.named('test') {
useJUnitPlatform()
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit edb7651

Please sign in to comment.