Skip to content

Actions to manage and synchronize entities between WooCommerce, WordPress and Algolia ๐Ÿ”Ž

License

Notifications You must be signed in to change notification settings

gzeta-adv/algolia-woocommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Algolia WooCommerce

GitHub Actions based utilities to manage and synchronize products between WooCommerce, WordPress and Algolia.

Prerequisites

You must download and activate the Node.js version specified here.

Copy the .env.example file to .env and fill in the necessary environment variables.

Setup

Clone the project or use it as a template:

gh repo clone gzeta-adv/algolia-woocommerce
# or
git clone https://github.com/gzeta-adv/algolia-woocommerce.git

Activate pnpm using corepack, install the dependencies and build the project:

corepack enable
corepack install
pnpm install
pnpm build

Actions

Each action can be run with either:

# In production mode with node
pnpm action <action-name>

# In development mode with tsx
pnpm action:dev <action-name>

Available Actions

sync

Syncs all products and categories between WooCommerce, WordPress and Algolia.

sync-categories

Syncs all categories between WooCommerce and Algolia.

sync-menu-items

Syncs all menu items between WordPress and Algolia.

sync-products

Syncs all products between WooCommerce and Algolia.

Triggers

The sync workflow is configured to run every 5 minutes, which is the GitHub limit for scheduled workflows.

Every workflow can also be triggered:

  • With a workflow_dispatch event via the GitHub interface

  • With a repository_dispatch event via the GitHub API:

    curl --request POST \
      --url 'https://api.github.com/repos/<repo>/dispatches' \
      --header 'authorization: Bearer <GITHUB_ACCESS_TOKEN>' \
      --data '{ "event_type": "<workflow-name>" }'