-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.6 KB
/
ci.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
name: Java CI with Gradle
#dev 브랜치로 pr할 때 CI 적용
on:
pull_request:
branches: [ "main" ]
types: [ opened, synchronize ]
push: # push 이벤트 발생 시
branches: # 타겟 브랜치
- main
#build 작업
jobs:
build:
#작업이 실행될 환경 지정
runs-on: ubuntu-latest
permissions:
contents: read
#각 단계가 순자적으로 진행
steps:
- uses: actions/checkout@v4
#JDK 17 설치
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Create main resources directory
run: mkdir -p src/main/resources
- name: Create test resources directory
run: mkdir -p src/test/resources
# main의 application.yml 생성
- name: Set Release YML File
run: |
cd ./src/main/resources
touch ./application.yml
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml
# test의 application.yml 생성
- name: Set Release Test YML File
run: |
cd ./src/test/resources
touch ./application.yml
echo "${{ secrets.APPLICATION_TEST_YML }}" > ./application.yml
#Gradle 설정 및 의존성 다운
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
#Permission Denied 해결
- name: Make gradlew executable
run: chmod +x ./gradlew
#빌드 작업 실행(테스트도 같이 진행)
- name: Build with Gradle Wrapper
run: ./gradlew build