Does the Algolia Netlify plugin work without a git repository configured?

Hello,

My Algolia-netlify plugin is not running on deploy.

My website is built on Hugo and hosted on Netlify. It’s repository is on a self-hosted GitLab in my home lab which is not accessible from outside. Because of this I am unable to integrate it directly with Netlify. So I always deploy manually using the CLI tool:

$ hugo -D && netlify deploy --prod

Will the plugin still run in this scenario?

What I read here suggests that the plugin will run in the context of a build. And I wonder if a build is happening at all because the deploy log shown in that topic has a lot more going on that my logs.

Here’s my latest deploy log:

8:56:20 PM: Creating deploy upload records
8:57:31 PM: Starting post processing
8:57:31 PM: Post processing - HTML
8:59:02 PM: Post processing - header rules
8:59:02 PM: Post processing - redirect rules
8:59:02 PM: Post processing done
8:59:03 PM: Site is live ✨

Please advise.

Regards.

Hi, yes the plugin should run, it has been built to run when the deploy succeeds (onSuccess event: Create Build Plugins | Netlify Docs)
Is the plugin correctly installed (does it appears in the Netlify Plugins tab)?
What is the associated Algolia AppID?

Hello,

I actually think it doesn’t run. From what I was able to understand, and Netlify interface makes that very clear, Builds (also called Deploys) will only run when the site is connected to a git repository.

I ended up moving my repo to GitHub and as soon as I did it I was able to configure a Build (pick an OS, etc) and everything started working.

Btw, I ended up not using Algolia Netlify plugin because, since my site is multilingual, I need to use two separate indices and found that the plugin only works with one index. I ended up using atomic-algolia which I call in a bash script that runs with the Build.

Ok too bad. I had understood that building from CLI was working the same way. Their doc Get started with Netlify CLI | Netlify Docs say:

You can run builds in Netlify CLI to mimic the behavior of running a build on Netlify — including Build Plugins.

But I hadn’t look further, thanks for testing!

For the multilingual website, may I ask why you need 2 indices? The plugin extracts the lang attribute in the records which should permits you to use facets at search time to support multiple languages.

1 Like

Clearly because I’m ignorant! Thank you for the tip :slight_smile: I’ll try again that way.

1 Like