Skip to content

Commit

Permalink
fix: json 생성 과정 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mingeun0507 committed Feb 28, 2024
1 parent df208b9 commit 194e5eb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ jobs:
run: echo ${{ secrets.FIREBASE_KEY_BASE64 }} | base64 --decode > ./src/main/resources/madii-app-firebase-adminsdk-uriyk-c04677456f.json
shell: bash

- name: create madii-app-firebase-adminsdk-uriyk-c04677456f.json
id: create-json
uses: jsdaniell/create-json@1.1.2
with:
name: "madii-app-firebase-adminsdk-uriyk-c04677456f.json"
json: ${{ secrets.FIREBASE_KEY_JSON }}
dir: "src/main/resources/"

- name: Gradle Caching
uses: actions/cache@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@
import com.google.firebase.FirebaseOptions;
import com.guttery.madii.common.exception.CustomException;
import com.guttery.madii.common.exception.ErrorDetails;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.io.FileInputStream;
import java.io.InputStream;

@Configuration
public class FirebaseConfig {
public class FirebaseConfig implements InitializingBean {
@Value("${firebase.config}")
private String firebaseKeyFilePath;
@Value("${firebase.project-id}")
private String firebaseProjectId;

@PostConstruct
public void initialize() {
@Override
public void afterPropertiesSet() {
initialize();
}

private void initialize() {
try (
final InputStream serviceAccount = new FileInputStream(firebaseKeyFilePath)
) {
Expand Down

0 comments on commit 194e5eb

Please sign in to comment.