Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SakinduRansindu committed Nov 14, 2024
1 parent f39d278 commit d47e715
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
Expand All @@ -11,19 +8,20 @@ jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY }}
NEXT_PUBLIC_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_AUTH_DOMAIN }}
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
NEXT_PUBLIC_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_STORAGE_BUCKET }}
NEXT_PUBLIC_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_MESSAGING_SENDER_ID }}
NEXT_PUBLIC_APP_ID: ${{ secrets.NEXT_PUBLIC_APP_ID }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set environment variables
env:
NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY }}
NEXT_PUBLIC_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_AUTH_DOMAIN }}
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
NEXT_PUBLIC_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_STORAGE_BUCKET }}
NEXT_PUBLIC_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_MESSAGING_SENDER_ID }}
NEXT_PUBLIC_APP_ID: ${{ secrets.NEXT_PUBLIC_APP_ID }}
run: echo "Environment variables set"
- name: Verify environment variables
run: echo "NEXT_PUBLIC_API_KEY is set to: ${NEXT_PUBLIC_API_KEY:0:4}****"

- name: Install dependencies and build
run: npm ci && npm run build
Expand Down
2 changes: 1 addition & 1 deletion src/services/firebaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ const firebaseConfig = {
appId: process.env.NEXT_PUBLIC_APP_ID
};

console.log(firebaseConfig.apiKey===undefined?'firebase configurations missing':'firebase configuration found 🔥🔥');
console.log(firebaseConfig.apiKey && firebaseConfig.apiKey===undefined?'firebase configurations missing':'firebase configuration found 🔥🔥');
// Initialize Firebase
export const app = initializeApp(firebaseConfig);

0 comments on commit d47e715

Please sign in to comment.