-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#491] Enhance CICD workflow for releasing production to Firebase App Distribution #554
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,68 @@ | ||||||
name: Deploy production to Firebase App Distribution | ||||||
|
||||||
on: | ||||||
# Trigger the workflow on push action in main branch. | ||||||
# So it will trigger when the PR of the feature branch was merged. | ||||||
push: | ||||||
branches: | ||||||
- main | ||||||
|
||||||
jobs: | ||||||
deploy_production_to_firebase_app_distribution: | ||||||
name: Deploy production to Firebase App Distribution | ||||||
runs-on: ubuntu-latest | ||||||
timeout-minutes: 30 | ||||||
steps: | ||||||
- name: Set up JDK 17 | ||||||
uses: actions/setup-java@v3 | ||||||
with: | ||||||
distribution: 'temurin' | ||||||
java-version: '17' | ||||||
|
||||||
- name: Set up timezone | ||||||
uses: zcong1993/setup-timezone@master | ||||||
with: | ||||||
timezone: Asia/Bangkok | ||||||
|
||||||
- name: Checkout source code | ||||||
uses: actions/checkout@v4 | ||||||
|
||||||
- name: Cache Gradle | ||||||
uses: actions/cache@v2 | ||||||
with: | ||||||
path: | | ||||||
~/.gradle/caches/modules-* | ||||||
~/.gradle/caches/jars-* | ||||||
~/.gradle/caches/build-cache-* | ||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-gradle- | ||||||
|
||||||
- name: Run Detekt | ||||||
run: ./gradlew detekt | ||||||
|
||||||
- name: Archive Detekt reports | ||||||
uses: actions/upload-artifact@v3 | ||||||
with: | ||||||
name: DetektReports | ||||||
path: build/reports/detekt/ | ||||||
|
||||||
- name: Run unit tests with Kover | ||||||
run: ./gradlew koverHtmlReport | ||||||
|
||||||
- name: Archive code coverage reports | ||||||
uses: actions/upload-artifact@v3 | ||||||
with: | ||||||
name: CodeCoverageReports | ||||||
path: app/build/reports/kover/ | ||||||
|
||||||
Comment on lines
+41
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO, we don't need these code analyzing & testing steps on CD workflows. Let's save our billing resources 🙏 Same for staging workflow |
||||||
- name: Build production APK | ||||||
run: ./gradlew assembleProductionRelease | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to set up keystore? |
||||||
|
||||||
- name: Deploy production to Firebase | ||||||
uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||||||
with: | ||||||
appId: ${{secrets.FIREBASE_APP_ID_PRODUCTION}} | ||||||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIAL_FILE_CONTENT }} | ||||||
groups: testers | ||||||
file: app/build/outputs/apk/production/debug/app-production-release.apk | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure deploy workflow does not need to
Set up timezone
step 🙏 Same for staging workflow