[setting] ci/cd 구축, 코드 리뷰어 자동지정 #8
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
| # CI.yml | |
| name: Ace Client CI | |
| # 워크플로우 트리거 설정 | |
| on: | |
| pull_request: | |
| # 어떤 브랜치에서 시작하여 어떤 브랜치를 향하든 모든 Pull Request에 대해 트리거 | |
| types: [ opened, synchronize, reopened ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # PR의 경우, PR이 draft 상태가 아닐 때만 실행합니다. | |
| if: github.event.pull_request.draft == false | |
| steps: | |
| - name: 코드 체크아웃 | |
| uses: actions/checkout@v4 | |
| - name: JDK 17 설정 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Gradle 캐시 설정 | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| # - name: local.properties 설정 | |
| # 프로젝트의 local.properties 파일에 필요한 환경 변수를 설정합니다. 이후, 서버가 배포되면 주석 해제하여 사용합니다. | |
| # run: | | |
| # echo "BASE_URL=${{ secrets.BASE_URL }}" >> local.properties | |
| - name: 디버그 APK 빌드 | |
| run: ./gradlew assembleDebug | |
| - name: 빌드 결과 아티팩트 저장 (선택 사항) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debug-apk | |
| path: app/build/outputs/apk/debug/app-debug.apk | |
| - name: Slack 알림 (빌드 성공) | |
| if: success() | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: success | |
| fields: workflow,job,commit,repo,author,took,ref | |
| author_name: GitHub Actions | |
| text: "✅ CI 빌드 성공! PR: #${{ github.event.pull_request.number }} - `${{ github.event.pull_request.title }}`" # 메시지 내용 | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| - name: Slack 알림 (빌드 실패) | |
| if: failure() | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: failure | |
| fields: workflow,job,commit,repo,author,took,ref | |
| author_name: GitHub Actions | |
| text: "❌ CI 빌드 실패! PR: #${{ github.event.pull_request.number }} - `${{ github.event.pull_request.title }}`" | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |