From 0c7450786f8ef6e0c7a86a73712c8c22669f5088 Mon Sep 17 00:00:00 2001 From: sryung Date: Thu, 14 Dec 2023 02:58:15 +0900 Subject: [PATCH] =?UTF-8?q?[=E2=9A=99=20:=20chore]=20Firebase=20Hosting=20?= =?UTF-8?q?-=20env=20API=20KEY=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Github 레포지토리의 Settings > Secrets and variable 에서 기존에 .env.local로 관리하던 API Key를 저장해 불러오도록 설정해주어야 함 --- .github/workflows/firebase-hosting-merge.yml | 4 ++++ .github/workflows/firebase-hosting-pull-request.yml | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 3057904..f72e029 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -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 diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 44e7827..ef883db 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -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 }}'