-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.7 KB
/
workflow-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Workflow 이름
name: CI workflow
# Event Trigger 환경
on:
pull_request:
branches: [ "develop" ] # pull request가 develop 브랜치에 생성되면 트리거
permissions: # 워크플로우 권한
contents: read # 읽기
jobs:
build:
# 실행환경 설정
runs-on: ubuntu-24.04
# Action을 사용하여 Step을 구성
steps:
- name: 체크아웃
uses: actions/checkout@v4 # GitHub repository 코드 체크아웃
# JDK 17 설치
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# resources 폴더 생성
- name: Create resources folder if not exist
run: |
if [ ! -d "./src/main/resources" ]; then
mkdir -p ./src/main/resources
fi
# application.yml 파일 생성
- name: make application.yml
run: |
touch ./src/main/resources/application.yml
echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml
shell: bash
# 빌드 속도 향상을 위한 Gradle 캐싱
- name: Gradle Caching
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
# 빌드를 위한 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x gradlew # Gradle wrapper에 실행 권한 부여
# Gradle을 사용하여 빌드 실행
- name: Build with Gradle Wrapper
run: ./gradlew clean build -x test