Cloud Functions does run or update Algolia index

When I deploy my function I get the normal “Deploy Complete” message but when I check Firebase>>Functions, there are no functions listed.

Secondly Algolia index is not auto updated. I can run the code on my machine and it updates the Algolia index, the problem is I have to do it manually, it is not automatic, I assumed if I update Firebase databse then the index will auto update but it is not.

index.json file

const algoliasearch = require('algoliasearch');
const dotenv = require('dotenv');
const firebase = require('firebase');

// load values from the .env file in this directory into process.env
dotenv.load();

// configure firebase
firebase.initializeApp({
databaseURL: process.env.FIREBASE_DATABASE_URL,
});
const database = firebase.database();

// configure algolia
 const algolia = algoliasearch(
 process.env.ALGOLIA_APP_ID,
 process.env.ALGOLIA_API_KEY
);
const index = algolia.initIndex(process.env.ALGOLIA_INDEX_NAME);

//synchronize firebase database with algolia index
const contactsRef = database.ref('/contactDetail');
contactsRef.on('child_added', addOrUpdateIndexRecord);
contactsRef.on('child_changed', addOrUpdateIndexRecord);
contactsRef.on('child_removed', deleteIndexRecord);

function addOrUpdateIndexRecord(contact) {
  // Get Firebase object
const record = contact.val();
// Specify Algolia's objectID using the Firebase object key
record.objectID = contact.key;
// Add or update object
index
.saveObject(record)
.then(() => {
  console.log('Firebase object indexed in Algolia', record.objectID);
})
.catch(error => {
  console.error('Error when indexing contact into Algolia', error);
  process.exit(1);
});
}

function deleteIndexRecord(contact) {
  // Get Algolia's objectID from the Firebase object key
  const objectID = contact.key;
  // Remove the object from Algolia
  index
    .deleteObject(objectID)
    .then(() => {
      console.log('Firebase object deleted from Algolia', objectID);
    })
    .catch(error => {
      console.error('Error when deleting contact from Algolia', error);
      process.exit(1);
    });
}

I am sort of new to programming.
link for the notes I followed here

Hi Wayne,

Thanks so much for getting in touch with your question regarding Firebase. I looked into your issue with synchronizing data and it would appear the guides do not mention a couple of items you will need to install/include for authentication, namely the firebase-admin module and the serviceAccountkey.json which can be downloaded from your firebase account. The instructions to get these set up are included on the GitHub repo linked at the bottom of the page for the guide. I recommend taking a look at the syncFirebaseToAlgolia.js file to help you get database update automation set up.
If you have any more questions or issues please do not hesitate to let us know!

Best,
Tobi