Skip to content

renaming fix

renaming fix #124

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase on Merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
# Install dependencies for both frontend and functions
- name: Install Dependencies
run: |
npm ci
cd functions && npm ci
# Create .env files for both frontend and functions
- name: Create environment files
run: |
# Frontend .env
echo "NEXT_PUBLIC_FIREBASE_CLIENT_API_KEY=${{ secrets.NEXT_PUBLIC_FIREBASE_CLIENT_API_KEY }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_CLIENT_AUTH_DOMAIN=${{ secrets.NEXT_PUBLIC_FIREBASE_CLIENT_AUTH_DOMAIN }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_CLIENT_PROJECT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_CLIENT_PROJECT_ID }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_CLIENT_STORAGE_BUCKET=${{ secrets.NEXT_PUBLIC_FIREBASE_CLIENT_STORAGE_BUCKET }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_CLIENT_MESSAGING_SENDER_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_CLIENT_MESSAGING_SENDER_ID }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_CLIENT_APP_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_CLIENT_APP_ID }}" >> .env
echo "NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}" >> .env
echo "NEXT_PUBLIC_MARVEL_ENDPOINT=${{ secrets.NEXT_PUBLIC_MARVEL_ENDPOINT }}" >> .env
# Functions .env
cd functions
echo "MARVEL_API_KEY=${{ secrets.MARVEL_API_KEY }}" >> .env
echo "MARVEL_ENDPOINT=${{ secrets.MARVEL_ENDPOINT }}" >> .env
# Build frontend
- name: Build Frontend
run: npm run build
# Deploy to Firebase
- name: Deploy to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KAI_AI_F63C8 }}
projectId: kai-ai-f63c8
channelId: live