-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.49 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
# workflow의 이름
name: CI
# 해당 workflow가 언제 실행될 것인지에 대한 트리거를 지정
on:
push:
branches:
- main # main branch로 push 될 때 실행됩니다.
- cicd # cicd branch로 push 될 때도 실행됩니다.
pull_request:
branches:
- main # main branch로 pull request될 때 실행됩니다.
- cicd # cicd branch로 pull request될 때도 실행됩니다.
#.
jobs:
build:
name: CI
runs-on: ubuntu-latest
steps:
# 작업에서 액세스할 수 있도록 $GITHUB_WORKSPACE에서 저장소를 체크아웃.
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
#githubsecrets yml 환경변수 주입.
- name: Set Yaml
uses: microsoft/variable-substitution@v1
with:
files: ./src/main/resources/application.yml
env:
spring.datasource.url: ${{ secrets.DB_URL }}
spring.datasource.username: ${{ secrets.DB_USERNAME }}
spring.datasource.password: ${{ secrets.DB_PASSWORD }}
spring.datasource.driver-class-name: ${{ secrets.DB_DRIVER }}
spring.jwt.secret: ${{ secrets.JWT_SECRET }}
#gradlew 실행을 위한 권한 추가
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
shell: bash
- name: Build with Gradle
run: ./gradlew build -x test
shell: bash