[FEAT/#226] Git Action CI/CD 워크플로우를 추가합니다.#242
Conversation
WalkthroughThis pull request introduces two new GitHub Actions workflows for an Android project: one for continuous deployment triggered by pull requests to the staging branch, and another for continuous integration triggered by pull requests to the develop branch. The workflows perform steps such as checking out the code, caching dependencies, setting up JDK/Android SDK, handling Firebase configurations, building artifacts, and notifying Discord. Additionally, the Firebase App Distribution plugin is integrated into the Gradle build files with dependency declarations added in the versions file. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GH_CD as GitHub Actions (CD)
participant Build as Android Build
participant FB as Firebase
participant DC as Discord
Dev->>GH_CD: Open PR to staging
GH_CD->>GH_CD: Checkout code, cache dependencies, setup JDK & SDK, update permissions
GH_CD->>GH_CD: Decode Firebase secrets & generate local.properties
GH_CD->>Build: Build release AAB
Build->>FB: Deploy AAB via Firebase App Distribution
GH_CD->>DC: Send notification via Discord webhook
sequenceDiagram
participant Dev as Developer
participant GH_CI as GitHub Actions (CI)
participant Build as Android Build
Dev->>GH_CI: Open PR to develop
GH_CI->>GH_CI: Checkout code, cache Gradle and SDK, setup JDK & SDK, update permissions
GH_CI->>GH_CI: Decode Firebase secrets & generate local.properties
GH_CI->>Build: Run lint checks and build the project
Assessment against linked issues
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/android_cd.yml(1 hunks).github/workflows/android_ci.yml(1 hunks)app/build.gradle.kts(1 hunks)build.gradle.kts(1 hunks)gradle/libs.versions.toml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (16)
build.gradle.kts (1)
12-12: Firebase App Distribution Plugin Alias AddedThe new alias added on line 12 –
alias(libs.plugins.firebase.app.distribution) apply false– correctly includes the Firebase App Distribution plugin in the build configuration. The use of
apply falseindicates that the plugin is conditionally applied; please ensure that this aligns with your intended usage across subprojects/modules and that corresponding configuration exists where the plugin is actually activated.app/build.gradle.kts (1)
17-17: Firebase App Distribution Plugin Enabled in the App ModuleThe addition of
alias(libs.plugins.firebase.app.distribution)on line 17 ensures that the Firebase App Distribution plugin is actively applied in the app module (unlike the top-level configuration where it is applied conditionally). This is appropriate since you want the plugin active for the app’s build and distribution. Verify that any additional configuration required by the plugin is included later in the build script or via the CI/CD workflows.
gradle/libs.versions.toml (2)
40-40: New Firebase App Distribution Version EntryThe addition of
firebase-app-distribution = "5.1.0"on line 40 in the
[versions]section correctly defines the required version. Ensure that this version is compatible with your other Firebase dependencies.
125-125: Firebase App Distribution Plugin DeclarationThe declaration in the
[plugins]section on line 125:firebase-app-distribution = { id = "com.google.firebase.appdistribution", version.ref = "firebase-app-distribution" }is correctly set up. Confirm that the version reference is resolved correctly to the version specified above.
.github/workflows/android_ci.yml (6)
1-11: CI Workflow Trigger ConfigurationThe workflow’s trigger is configured to run on pull requests to the
developbranch affecting files in theappmodule, the top-level build file, or any Kotlin files. This granular trigger helps limit CI runs to relevant changes.
22-33: Efficient Dependency CachingThe caching steps for Gradle packages (lines 24–33) and the Android SDK (lines 35–40) are appropriately set up. These steps should help reduce build times by reusing cached dependencies across workflow runs.
45-51: JDK and Android SDK SetupThe steps for setting up JDK 17 (lines 45–51) using the Corretto distribution and installing the Android SDK (lines 52–55) align with Android’s official recommendations. No issues found.
60-64: Secure Decoding of Firebase SecretsThe step on lines 60–64 decodes the
google-services.jsonsecurely from a Base64-encoded secret. This ensures that sensitive information is handled securely during the CI run. Verify that the secretFIREBASE_SECRETis correctly set in the repository’s secrets.
67-80: Generation of local.propertiesThe generation of the
local.propertiesfile (lines 67–80) using environment variables for API keys and URLs is implemented correctly. Make sure that the key names and the overall file format match what your build logic expects inapp/build.gradle.kts.
82-84: Lint and Build CommandThe final step on lines 82–84 that runs
./gradlew --no-daemon --configuration-cache ktlintCheck assembleDebugcombines linting and building effectively. This should help catch style or quality issues early in the CI process..github/workflows/android_cd.yml (6)
1-6: CD Workflow Trigger SettingsThe workflow is set to trigger on pull requests targeting the
stagingbranch (lines 3–6), which matches the intended continuous deployment scenario. This focused trigger helps separate CD from CI processes.
12-27: Caching and Environment Setup for DeploymentThe caching (lines 18–27) and environment setup steps (JDK, Android SDK, and gradlew permission on lines 28–43) mirror the best practices seen in the CI workflow, ensuring consistency and optimized build times.
40-43: File Permission and Firebase Secret DecodingThe steps to change permissions on the
gradlewscript and to decodegoogle-services.json(lines 40–49) are sound. Confirm that the environment variableFIREBASE_SECRETin your GitHub repository holds the correct Base64-encoded JSON.
50-64: local.properties Generation for DeploymentThe generation of
local.properties(lines 50–64) using environment variables ensures that build configurations such as base URLs and API keys are securely injected into the build process. This approach is consistent with the CI workflow and should work as expected.
65-68: Release AAB Build ProcessThe command on lines 65–68,
./gradlew bundleRelease --stacktrace, instructs Gradle to build the release Android App Bundle (AAB) with stacktrace enabled for debugging build failures. Confirm that the output location of the AAB matches what is expected in the distribution step.
77-86: Firebase App Distribution and Discord NotificationThe final steps on lines 77–86 handle uploading the AAB to Firebase App Distribution and notifying a Discord channel via webhook. Both commands are appropriately configured, but please double-check that:
- The AAB file path (
app/build/outputs/bundle/release/app-release.aab) is correct.- All required secrets (e.g.,
FIREBASE_APP_ID,DISCORD_WEBHOOK_URL) are present and correctly set in the repository’s secrets.
| # Firebase 인증 | ||
| - name: Set up Firebase Service Account Credentials | ||
| env: | ||
| GOOGLE_APPLICATION_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }} | ||
| run: | | ||
| echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" | base64 --decode > $HOME/firebase-credentials.json | ||
| export GOOGLE_APPLICATION_CREDENTIALS=$HOME/firebase-credentials.json | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Firebase Service Account Credentials Setup
The steps on lines 69–76 decode the Firebase service account credentials and set the GOOGLE_APPLICATION_CREDENTIALS environment variable.
Note: Consider adding an explicit step to install the Firebase CLI (for example, using
npm install -g firebase-tools) if it is not pre-installed on theubuntu-latestimage. This ensures that the subsequent Firebase distribution command will execute reliably.
SYAAINN
left a comment
There was a problem hiding this comment.
제가 local.properties 인식이 안돼서 ktlint 체크 오류 나는거 어떻게 아시고 ㅎㅎ yml파일이랑 github secrets 설정 야무지게 배웠습니다 수고하셨슴둥
📌 ISSUE
closed #226
📄 Work Description
✨ PR Point
어우 깃 꼬여서 이전 pr 닫고 다시 올렸습니다..

📸 ScreenShot/Video
Summary by CodeRabbit