Skip to content

Commit 1292132

Browse files
committed
[setting/#1] CI 빌드 yml 생성
- jdk 17 - apk 빌드 - 슬랙 알림
1 parent c6df119 commit 1292132

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/ace_build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# CI.yml
2+
name: Ace Client CI
3+
4+
# 워크플로우 트리거 설정
5+
on:
6+
pull_request:
7+
# 어떤 브랜치에서 시작하여 어떤 브랜치를 향하든 모든 Pull Request에 대해 트리거
8+
types: [ opened, synchronize, reopened ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
# PR의 경우, PR이 draft 상태가 아닐 때만 실행합니다.
14+
if: github.event.pull_request.draft == false
15+
16+
steps:
17+
- name: 코드 체크아웃
18+
uses: actions/checkout@v4
19+
20+
- name: JDK 17 설정
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: '17'
25+
26+
- name: Gradle 캐시 설정
27+
uses: actions/cache@v4
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
~/.gradle/wrapper
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
33+
restore-keys: |
34+
${{ runner.os }}-gradle-
35+
36+
- name: local.properties 설정
37+
# 프로젝트의 local.properties 파일에 필요한 환경 변수를 설정합니다. 이후, 서버가 배포되면 주석 해제하여 사용합니다.
38+
# run: |
39+
# echo "BASE_URL=${{ secrets.BASE_URL }}" >> local.properties
40+
41+
- name: 디버그 APK 빌드
42+
run: ./gradlew assembleDebug
43+
44+
- name: 빌드 결과 아티팩트 저장 (선택 사항)
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: debug-apk
48+
path: app/build/outputs/apk/debug/app-debug.apk
49+
50+
- name: Slack 알림 (빌드 성공)
51+
# 빌드 성공 시 Slack으로 알림을 보냅니다.
52+
if: success()
53+
uses: rtCamp/action-slack-notify@v2
54+
env:
55+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
56+
SLACK_CHANNEL: '#client-actions' # 알림을 받을 Slack 채널
57+
SLACK_MESSAGE: "✅ CI 빌드 성공! PR: #${{ github.event.pull_request.number }} - `${{ github.event.pull_request.title }}`"
58+
59+
- name: Slack 알림 (빌드 실패)
60+
if: failure()
61+
uses: rtCamp/action-slack-notify@v2
62+
env:
63+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
64+
SLACK_CHANNEL: '#client-actions'
65+
SLACK_MESSAGE: "❌ CI 빌드 실패! PR: #${{ github.event.pull_request.number }} - `${{ github.event.pull_request.title }}`"
66+
SLACK_COLOR: 'danger'

0 commit comments

Comments
 (0)