Skip to content

Commit

Permalink
[⚙ : chore] Firebase Hosting - env API KEY 적용
Browse files Browse the repository at this point in the history
- Github 레포지토리의 Settings > Secrets and variable 에서 기존에 .env.local로 관리하던 API Key를 저장해 불러오도록 설정해주어야 함
  • Loading branch information
sryung1225 committed Dec 13, 2023
1 parent a3b1d40 commit 0c74507
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm install
- name: Echo Env
run: echo "VITE_FIREBASE_API_KEY=${{secrets.VITE_FIREBASE_API_KEY}}" >> .env
- name: Cat Env
run: cat .env
- name: Build
run: npm run build
- name: Deploy to Firebase Hosting
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ jobs:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
- name: Install Dependencies
run: npm install
- name: Echo Env
run: echo "VITE_FIREBASE_API_KEY=${{secrets.VITE_FIREBASE_API_KEY}}" >> .env
- name: Cat Env
run: cat .env
- name: Build
run: npm run build
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_XWITTER_C64EF }}'
Expand Down

0 comments on commit 0c74507

Please sign in to comment.