Skip to content

Fixed maps and Google SSO, Updated iOS SSO logic. (#513) #308

Fixed maps and Google SSO, Updated iOS SSO logic. (#513)

Fixed maps and Google SSO, Updated iOS SSO logic. (#513) #308

# Nonprofit Social Networking Platform: Allowing Users and Organizations to Collaborate.
# Copyright (C) 2023 ASCENDynamics NFP
# This file is part of Nonprofit Social Networking Platform.
# Nonprofit Social Networking Platform is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Nonprofit Social Networking Platform is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with Nonprofit Social Networking Platform. If not, see <https://www.gnu.org/licenses/>.
name: Build and Deploy to Firebase on Merge (Development)
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v4
# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
# Set up Java for Firebase emulators
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
# Install dependencies
- name: Install Dependencies
run: npm ci
# Run Angular tests first (don't need Firebase CLI)
- name: Run Angular Tests
run: npx ng test --watch=false
# Set Environment Variables
- name: Set Environment Variables
run: |
echo "CI=true" >> $GITHUB_ENV
echo "NODE_ENV=development" >> $GITHUB_ENV
echo "FIREBASE_API_KEY=${{ secrets.DEV_FIREBASE_API_KEY }}" >> $GITHUB_ENV
echo "FIREBASE_AUTH_DOMAIN=${{ secrets.DEV_FIREBASE_AUTH_DOMAIN }}" >> $GITHUB_ENV
echo "FIREBASE_DATABASE_URL=${{ secrets.DEV_FIREBASE_DATABASE_URL }}" >> $GITHUB_ENV
echo "FIREBASE_PROJECT_ID=${{ secrets.DEV_FIREBASE_PROJECT_ID }}" >> $GITHUB_ENV
echo "FIREBASE_STORAGE_BUCKET=${{ secrets.DEV_FIREBASE_STORAGE_BUCKET }}" >> $GITHUB_ENV
echo "FIREBASE_MESSAGING_SENDER_ID=${{ secrets.DEV_FIREBASE_MESSAGING_SENDER_ID }}" >> $GITHUB_ENV
echo "FIREBASE_APP_ID=${{ secrets.DEV_FIREBASE_APP_ID }}" >> $GITHUB_ENV
echo "FIREBASE_MEASUREMENT_ID=${{ secrets.DEV_FIREBASE_MEASUREMENT_ID }}" >> $GITHUB_ENV
echo "GOOGLE_MAPS_API_KEY=${{ secrets.DEV_GOOGLE_MAPS_API_KEY }}" >> $GITHUB_ENV
# Install Firebase CLI for function tests
- name: Install Firebase CLI
run: |
npm install -g firebase-tools
echo "$(npm config get prefix)/bin" >> $GITHUB_PATH
firebase --version
which firebase
# Install Functions Dependencies
- name: Install Functions Dependencies
run: npm ci --prefix functions
# Authenticate to Google Cloud (BEFORE function tests)
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ASCENDCOOPPLATFORM_DEV }}'
project_id: '${{ secrets.DEV_FIREBASE_PROJECT_ID }}'
export_environment_variables: true
create_credentials_file: true
# Run Firebase function tests
- name: Run Firebase Function Tests
run: |
echo "PATH: $PATH"
which firebase || echo "Firebase CLI not found in PATH"
firebase --version || echo "Firebase CLI version check failed"
npm --prefix functions test
# Build the project (Development)
- name: Build Project
run: |
npm run generate-env:dev
npx ng build --configuration development
# Set up Cloud SDK
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
# Deploy to Firebase
- name: Deploy to Firebase
run: |
echo "PATH: $PATH"
which firebase
firebase deploy --project ${{ secrets.DEV_FIREBASE_PROJECT_ID }}