File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Spring Boot CI Pipeline
2+
3+ # 워크플로우 실행 조건
4+ on :
5+ push :
6+ branches : [ "main" ] # main 브랜치에 push될 때
7+ pull_request :
8+ branches : [ "develop" ] # develop 브랜치로 PR이 생성/업데이트될 때
9+
10+ jobs :
11+ build-and-test : # 빌드와 테스트를 위한 단일 작업
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ # 1. 저장소 코드 체크아웃 (최신 버전 v4 사용)
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+
19+ # 2. JDK 17 설정 및 Gradle 캐싱 (최신 버전 v4 사용)
20+ - name : Set up JDK 17
21+ uses : actions/setup-java@v4
22+ with :
23+ java-version : ' 17'
24+ distribution : ' temurin'
25+ cache : ' gradle' # Gradle 의존성을 캐싱하여 다음 빌드부터 속도를 향상시킵니다.
26+
27+ # 3. GitHub Secret을 사용하여 application.yml 파일 생성
28+ # 디렉토리가 없는 경우에도 안전하게 생성하도록 'mkdir -p'를 사용합니다.
29+ - name : Make application.yml
30+ run : |
31+ mkdir -p ./src/main/resources
32+ echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
33+ shell : bash
34+
35+ # 4. gradlew 실행 권한 부여
36+ - name : Grant execute permission for gradlew
37+ run : chmod +x ./gradlew
38+
39+ # 5. Gradle로 빌드 및 테스트 실행 (최신 버전 v3 사용)
40+ # Gradle의 'build' 명령어는 컴파일, 테스트 실행, jar 파일 패키징을 모두 수행합니다.
41+ - name : Build with Gradle
42+ uses : gradle/gradle-build-action@v3
43+ with :
44+ arguments : build
You can’t perform that action at this time.
0 commit comments