Fix Firebase authentication with consistent credential paths #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy to Firebase | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build Astro site | |
| run: npm run build | |
| - name: Setup Firebase credentials | |
| run: | | |
| echo "$FIREBASE_SERVICE_ACCOUNT" > ${{ runner.temp }}/gcloud-key.json | |
| env: | |
| FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | |
| - name: Install Firebase CLI | |
| run: npm install -g firebase-tools | |
| - name: Deploy to Firebase Hosting | |
| run: firebase deploy --only hosting --non-interactive --project notifuse | |
| env: | |
| GOOGLE_APPLICATION_CREDENTIALS: ${{ runner.temp }}/gcloud-key.json |