Skip to content

Commit

Permalink
Updated by gitbook-action 2024-01-11 06:21:01
Browse files Browse the repository at this point in the history
  • Loading branch information
wellbeing-dough committed Jan 11, 2024
1 parent 5cf0cc1 commit e498779
Show file tree
Hide file tree
Showing 13 changed files with 738 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
<link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">


<link rel="next" href="FCM%20secret.json을%20%08CICD에서%20숨겨서%20배포하기.html" />


<link rel="prev" href="Github%20Actions,%20ec2%20timezone변경.html" />

Expand Down Expand Up @@ -392,6 +394,19 @@



</li>

<li class="chapter " data-level="1.4.1.1.4" data-path="FCM%20secret.json을%20%08CICD에서%20숨겨서%20배포하기.html">

<a href="FCM%20secret.json을%20%08CICD에서%20숨겨서%20배포하기.html">


Deploy Secret.json

</a>



</li>


Expand Down Expand Up @@ -509,19 +524,23 @@ <h1 class="search-results-title">No results matching "<span class='search-query'



<a href="Github%20Actions,%20ec2%20timezone변경.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: EC2 Timezone">
<a href="Github%20Actions,%20ec2%20timezone변경.html" class="navigation navigation-prev " aria-label="Previous page: EC2 Timezone">
<i class="fa fa-angle-left"></i>
</a>


<a href="FCM%20secret.json을%20%08CICD에서%20숨겨서%20배포하기.html" class="navigation navigation-next " aria-label="Next page: Deploy Secret.json">
<i class="fa fa-angle-right"></i>
</a>



</div>

<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Deploy Timezone","level":"1.4.1.1.3","depth":4,"previous":{"title":"EC2 Timezone","level":"1.4.1.1.2","depth":4,"path":"dongwoo/project/studyHub/Github%20Actions,%20ec2%20timezone변경.md","ref":"dongwoo/project/studyHub/Github%20Actions,%20ec2%20timezone변경.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["collapsible-chapters","comment","hide-published-with","github"],"pluginsConfig":{"github":{"url":"https://github.com/inu-appcenter/server-tech-blog"},"search":{},"collapsible-chapters":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"hide-published-with":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"comment":{"highlightCommented":true}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"dongwoo/project/studyHub/CI서버 Repository Test 에서 시간 정렬이 안되는 이슈.md","mtime":"2023-12-17T08:02:40.610Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-12-17T08:03:09.513Z"},"basePath":"../../..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Deploy Timezone","level":"1.4.1.1.3","depth":4,"next":{"title":"Deploy Secret.json","level":"1.4.1.1.4","depth":4,"path":"dongwoo/project/studyHub/FCM%20secret.json을%20%08CICD에서%20숨겨서%20배포하기.md","ref":"dongwoo/project/studyHub/FCM%20secret.json을%20%08CICD에서%20숨겨서%20배포하기.md","articles":[]},"previous":{"title":"EC2 Timezone","level":"1.4.1.1.2","depth":4,"path":"dongwoo/project/studyHub/Github%20Actions,%20ec2%20timezone변경.md","ref":"dongwoo/project/studyHub/Github%20Actions,%20ec2%20timezone변경.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["collapsible-chapters","comment","hide-published-with","github"],"pluginsConfig":{"github":{"url":"https://github.com/inu-appcenter/server-tech-blog"},"search":{},"collapsible-chapters":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"hide-published-with":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"comment":{"highlightCommented":true}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"dongwoo/project/studyHub/CI서버 Repository Test 에서 시간 정렬이 안되는 이슈.md","mtime":"2024-01-11T06:21:01.866Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2024-01-11T06:21:30.469Z"},"basePath":"../../..","book":{"language":""}});
});
</script>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## 문제점
1. FCM 시크릿키는 숨겨야 함
2. secret.json을 이그노어 함
3. 그럼 github actions의 CICD에서는 이그노어 된 파일을 볼 수 없음
4. yml의 환경변수가 아니라 json이라서 ELB 환경변수에 넣기도 힘듬

## 해결 방법
1. 깃헙 시크릿 키에 json파일을 저장
2. deploy.yml에서 빌드하기전에 src/main/resources/firebase 경로에 시크릿 키에서 가져온 json 넣는 스크립트 코드 작성

이렇게 하려 했는데 github actions에서 시크릿에 json 넣는것을 피하라 했다
```
To help ensure that GitHub redacts your secret in logs,
avoid using structured data as the values of secrets.
For example, avoid creating secrets that contain JSON or encoded Git blobs.
```
그래서 해결하다가 중간에 바꿨다
1. 깃헙 시크릿에 json파일을 base64로 인코딩 하여 저장
2. deploy.yml에서 빌드하기전에 시크릿에서 가져온 json base64로 디코딩
3. src/main/resources/firebase 에 디코딩한 json저장

```
- name: Setup Firebase service key
run: |
mkdir -p src/main/resources/firebase
echo ${{ secrets.FIREBASE_SERVICE_KEY_BASE64_ENCODE }} | base64 -d > src/main/resources/firebase/firebase-service-key.json
```

Loading

0 comments on commit e498779

Please sign in to comment.