Skip to content

Commit

Permalink
fix: Firebase Admin SDK JSON file path
Browse files Browse the repository at this point in the history
  • Loading branch information
okodeee committed Jun 11, 2024
1 parent 01b24ed commit 7a0a21d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,19 @@ jobs:
oauth2.google.resource-uri: ${{ secrets.RESOURCE_URI }}
jwt.secret: ${{ secrets.JWT_SECRET }}
# 2-2) Create Firebase Admin SDK JSON file
# - name: Create Firebase Admin SDK JSON file
# env:
# FIREBASE_ADMIN_SDK: ${{ secrets.FIREBASE_ADMIN_SDK }}
# run: |
# mkdir -p firebase
# echo "$FIREBASE_ADMIN_SDK" > firebase/vomvom-fd09b-firebase-adminsdk-ghtjs-0070b39a4e.json
# env:
# FIREBASE_CONFIG_PATH: firebase/vomvom-fd09b-firebase-adminsdk-ghtjs-0070b39a4e.json
# 3) gradlew 권한 설정
- name: Create Firebase Admin SDK JSON file
env:
FIREBASE_ADMIN_SDK: ${{ secrets.FIREBASE_ADMIN_SDK }}
run: |
mkdir -p src/main/firebase/resources/firebase
echo "$FIREBASE_ADMIN_SDK" > src/main/firebase/resources/firebase/vomvom-fd09b-firebase-adminsdk-ghtjs-0070b39a4e.json
# 3) gradlew 권한 설정
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# working-directory: ${{ env.working-directory }}
# 4) test 제외 gradle 빌드
- name: Build with Gradle
run: ./gradlew clean build -x test
# env:
# FIREBASE_CONFIG_PATH: firebase/vomvom-fd09b-firebase-adminsdk-ghtjs-0070b39a4e.json
# working-directory: ${{ env.working-directory }}
# 5) AWS 인증
- name: Configure AWS credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ public int sendMessageTo(Long memberId) throws IOException {
*/
private String getAccessToken() throws IOException {

String firebaseConfigPath = System.getenv("FIREBASE_CONFIG_PATH");
if (firebaseConfigPath == null) {
firebaseConfigPath = "firebase/vomvom-fd09b-firebase-adminsdk-ghtjs-0070b39a4e.json";
}
String firebaseConfigPath = "firebase/vomvom-fd09b-firebase-adminsdk-ghtjs-0070b39a4e.json";

GoogleCredentials googleCredentials = GoogleCredentials
.fromStream(new ClassPathResource(firebaseConfigPath).getInputStream())
Expand Down

0 comments on commit 7a0a21d

Please sign in to comment.