Skip to content

Commit

Permalink
feat: create functions group
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Jan 17, 2024
1 parent 97d87cf commit 3126485
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ jobs:
- name: Build Back
run: npm --prefix functions install
- name: Deploy to Firebase for Devfest Lille
run: npx firebase-tools deploy -P default
run: |
npx firebase-tools deploy -P default --only hostings
npx firebase-tools deploy -P default --only firestore:rules
npx firebase-tools deploy -P default --only functions:cms4devfestgdg
env:
FIREBASE_TOKEN: ${{ secrets.DEVFEST_FIREBASE_TOKEN }}
- name: Deploy to Firebase for Devfest Lille
run: npx firebase-tools deploy -P cloudnord
run: |
npx firebase-tools deploy -P cloudnord --only hostings
npx firebase-tools deploy -P cloudnord --only firestore:rules
npx firebase-tools deploy -P cloudnord --only functions:cms4devfestcloudnord
env:
FIREBASE_TOKEN: ${{ secrets.CLOUDNORD_FIREBASE_TOKEN }}
2 changes: 1 addition & 1 deletion functions/src/cms4devfest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import relancePaiement from "./emails/template/relancePaiement";
import relanceInformationsComplementaires from "./emails/template/relanceInformationsComplementaires";
import { Settings } from "./model";

admin.initializeApp();
const firestore = admin.firestore();

function sendWelcomeEmail(company: DocumentData, id: string, settings: Settings) {
const emailTemplate = WelcomeEmailFactory(company, id, settings);
return sendEmailToAllContacts(company, emailTemplate, settings);
Expand Down
11 changes: 7 additions & 4 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import * as admin from "firebase-admin";
import * as cms4devfestFunctions from "./cms4devfest";
import * as cms4devfestFunctionsGdg from "./cms4devfest-gdg";

admin.initializeApp();
export const cms4devfestgdg = {
...cms4devfestFunctions,
...cms4devfestFunctionsGdg,
};

export const cms4devfest = cms4devfestFunctions;
export const cms4devfestgdg = cms4devfestFunctionsGdg;
export const cms4devfestcloudnord = {
...cms4devfestFunctions,
};

0 comments on commit 3126485

Please sign in to comment.