Merge pull request #10 from UMC-9th-Spring-Boot/Week8 #11
This file contains hidden or 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: Java CI with Gradle | |
| # 워크플로우 실행 조건 | |
| on: | |
| push: | |
| branches: [ "main" ] # main 브랜치에 push될 때 실행 | |
| pull_request: | |
| branches: [ "main" ] # main 브랜치에 pull_request될 때 실행 | |
| workflow_dispatch: # Actions 탭에서 수동으로 실행 가능하도록 설정 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. 코드 체크아웃 | |
| - uses: actions/checkout@v4 | |
| # 2. JDK 21 설정 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: 'gradle' # Gradle 캐시 자동화 (빌드 속도 향상) | |
| # 3. GitHub Secret을 사용하여 application.yml 파일 생성 | |
| - name: Make application.yml | |
| run: | | |
| mkdir -p ./src/main/resources | |
| echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml | |
| shell: bash | |
| # 4. gradlew 실행 권한 부여 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x ./gradlew | |
| # 5. Gradle 빌드 (테스트 제외) | |
| - name: Build Gradle (without test) | |
| run: ./gradlew bootJar -x test |