This is a wrapper of the jekyll-algolia plugin.
This action pushes all your content in an Algolia index.
Full reference on the jekyll-algolia documentation.
-
On your Algolia account (free Community plan available), get your credentials from your dashboard.
-
On your
_config.yml, write:
algolia:
application_id: YOUR_APPLICATION_ID
index_name: YOUR_INDEX_NAME # You can replace that with whatever name you want
search_only_api_key: YOUR_SEARCH_ONLY_API_KEY
- Add
jekyll-algoliato yourGemfile, as part of the:jekyll-pluginsgroup.
source 'https://rubygems.org'
gem 'jekyll', '~> 3.6'
group :jekyll_plugins do
gem 'jekyll-algolia'
end- Important: On your GitHub repo, go to Settings > Secrets and set a new secret:
| Name | Value |
|---|---|
ALGOLIA_API_KEY |
YOUR_ADMIN_API_KEY |
Create a workflow file (e.g. algolia-search.yml) in your-repo/.github/workflows/ directory, similar to:
on:
push:
branches:
- master
- main
name: algolia-search
jobs:
algolia-search:
runs-on: ubuntu-latest
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Algolia Jekyll Action
uses: dieghernan/algolia-jekyll-action@main
with:
APIKEY: '${{ secrets.ALGOLIA_API_KEY }}'
This action would run on every commit on the main/master. For more trigger events see this link.
APIKEY: Required. It is better to use GitHub Secrets (see above) instead the actual value on the action, for security reasons.ruby-version: Version of Ruby to use on build. Default is'2.6'.cache-version: default1. If you need to invalidate the existing cache pass any other number and a new cache will be used.jekyll_src: default"". Jekyll website source directory. Use it if the source of your site is in a subfolder (e.gdocs, etc.).
This software is in no way officially related to or endorsed by Algolia.