Skip to content

Commit cfb92f4

Browse files
authored
Trigger Algolia search reindex on gh-pages built event and manually (#189)
* wip * wip * update trigger events
1 parent 083a906 commit cfb92f4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Trigger Algolia Search Reindex
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# trigger automatically when gh-pages is built
7+
page_build:
8+
9+
jobs:
10+
trigger:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Wait for gh-page cache update
14+
if: github.event_name == 'page_build' && github.event.build.status == 'built'
15+
run: sleep 60
16+
17+
- name: Trigger search reindex
18+
run: |
19+
curl -X POST "https://crawler.algolia.com/api/1/crawlers/${{ secrets.ALGOLIA_CRAWLER_ID }}/reindex" \
20+
--user "${{ secrets.ALGOLIA_USER_ID }}":"${{ secrets.ALGOLIA_TOKEN }}"

0 commit comments

Comments
 (0)