[#230] 스플래시, 로그인 리디자인 적용 #323
Workflow file for this run
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
| name: Team6 CI | |
| on: | |
| pull_request: | |
| branches: [ develop, main ] | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: . | |
| jobs: | |
| build: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Gradle cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| - name: Change gradlew permissions | |
| run: chmod +x ./gradlew | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Touch local properties | |
| run: touch local.properties | |
| - name: Debug Base64 Decoding | |
| run: | | |
| echo "$FIREBASE_SECRET" | base64 --decode || echo "Base64 Decode Failed" | |
| # ✅ google-services.json 복원 (base64 디코딩) | |
| - name: Decode google-services.json | |
| env: | |
| FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }} | |
| run: | | |
| echo $FIREBASE_SECRET | base64 --decode > app/google-services.json | |
| ls -l app | |
| cat app/google-services.json | jq . | |
| # ✅ local.properties 생성 및 환경 변수 추가 | |
| - name: Access local properties | |
| env: | |
| BASE_URL: ${{ secrets.BASE_URL }} | |
| AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} | |
| run: | | |
| echo "dev.base.url=\"$BASE_URL\"" >> local.properties | |
| echo "amplitude.dev.api.key=\"AMPLITUDE_API_KEY\"" >> local.properties | |
| # ✅ Lint Check | |
| - name: Lint Check | |
| run: ./gradlew ktlintCheck -PcompileSdkVersion=34 | |
| # ✅ Build with Gradle | |
| - name: Build with Gradle | |
| run: ./gradlew build -PcompileSdkVersion=34 | |
| # ✅ 버전 정보 추출 및 API 호출 | |
| - name: Update App Version | |
| if: ${{ success() }} | |
| env: | |
| SERVER_DEV_URL: ${{ secrets.SERVER_DEV_URL }} | |
| SERVER_PROD_URL: ${{ secrets.SERVER_PROD_URL }} | |
| VERSION_API_ENDPOINT: ${{ secrets.VERSION_API_ENDPOINT }} | |
| run: | | |
| VERSION_NAME=$(grep -E "versionName\s*=" app/build.gradle.kts | sed 's/.*versionName\s*=\s*"\([^"]*\)".*/\1/') | |
| if [[ ! $VERSION_NAME =~ ^v ]]; then | |
| VERSION_NAME="v$VERSION_NAME" | |
| fi | |
| echo "Current version: $VERSION_NAME" | |
| # 개발 서버에 API 호출 | |
| echo "Updating DEV server..." | |
| (curl -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"version\": \"$VERSION_NAME\"}" \ | |
| "${SERVER_DEV_URL}${VERSION_API_ENDPOINT}" \ | |
| && echo "DEV server updated successfully") \ | |
| || echo "DEV server update failed, but continuing..." | |
| # 운영 서버에 API 호출 | |
| echo "Updating PROD server..." | |
| (curl -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"version\": \"$VERSION_NAME\"}" \ | |
| "${SERVER_PROD_URL}${VERSION_API_ENDPOINT}" \ | |
| && echo "PROD server updated successfully") \ | |
| || echo "PROD server update failed, but continuing..." | |
| echo "Version update process completed" | |
| # ✅ 성공 알림 | |
| - name: Slack Notify - Success | |
| if: ${{ success() }} | |
| uses: rtCamp/action-slack-notify@v2 | |
| env: | |
| SLACK_COLOR: '#B7FF1D' | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_TITLE: '✅ PR Success ✅' | |
| SLACK_USERNAME: DEPORMEET-TEAM6 🍗 | |
| SLACK_MESSAGE: 'PR이 완료되었습니다! 😆' | |
| # ❌ 실패 알림 | |
| - name: Slack Notify - Failure | |
| if: ${{ failure() }} | |
| uses: rtCamp/action-slack-notify@v2 | |
| env: | |
| SLACK_COLOR: '#FF9254' | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_TITLE: '❌ PR Failed ❌' | |
| SLACK_USERNAME: DEPORMEET-TEAM6 🍗 | |
| SLACK_MESSAGE: '에러를 확인해 주세요 🫨' |