-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (83 loc) · 2.81 KB
/
firebase_cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Firebase CD
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Update Secrets
env:
KOIN_STORE_PASSWORD: ${{ secrets.KOIN_STORE_PASSWORD}}
NAVER_MAP_KEY: ${{ secrets.NAVER_MAP_KEY}}
SECRET_KEY : ${{ secrets.SECRET_KEY }}
PROPERTIES : ${{ secrets.PROPERTIES }}
run: |
echo $PROPERTIES | base64 -di > ./local.properties
echo $SECRET_KEY | base64 -di > ./koin/team_kap_android.jks
for file in $(find . -name 'local.properties')
do
echo $file
done
for file in $(find . -name 'team_kap_android.jks')
do
echo $file
done
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g firebase-tools
- name: Update Firebase
env:
FIREBASE: ${{ secrets.FIREBASE }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
run: |
echo $FIREBASE | base64 -di > ./koin/google-services.json
echo $GOOGLE_CREDENTIALS | base64 -di > ./google-credentials.json
for file in $(find . -name 'google-services.json')
do
echo $file
done
for file in $(find . -name 'google-credentials.json ')
do
echo $file
done
- name: Build with Gradle
run: ./gradlew koin:assembleRelease
- name: Upload to Firebase
env:
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
GOOGLE_APPLICATION_CREDENTIALS : "./google-credentials.json"
run: |
apk_path="./koin/build/outputs/apk/release/koin-release.apk"
firebase \
appdistribution:distribute \
"$apk_path" \
--app "$FIREBASE_PROJECT_ID" \
--groups "bcsd" \
--debug
- name: Upload to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Android Firebase Deploy
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()