Skip to content

Merge pull request #1183 from tilburgsciencehub/1138-revision-topics/… #631

Merge pull request #1183 from tilburgsciencehub/1138-revision-topics/…

Merge pull request #1183 from tilburgsciencehub/1138-revision-topics/… #631

name: Algolia-Updater
# Controls when the workflow will run
on:
# Triggers the workflow on push events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "update_search_index"
update_search_index:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Set up python
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8 # install the version needed
# Install pandas
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pandas
# Change directory and generate the json index
- name: execute py script # run the python script to build the index
run: |
cd content
python create-search-index.py
# Push to Algolia
- uses: tilburgsciencehub/algolia-uploader@master
with:
app_id: 02IYLG4AP9
# Secret token in the organization's 'Setting > Secrets'
admin_key: ${{ secrets.ALGOLIA_ADMIN_KEY }}
# The index name, use 'tilburgsciencehub' to debug
index_name: Tilburg_Science_Hub
# relative path to the json index
index_file_path: ./content/search-index.json