Skip to content

Update Schemas

Update Schemas #4

name: Update Schemas
on:
# Trigger the workflow every Monday at 08:00 Belgrade time (adjusted for UTC)
schedule:
- cron: '0 7 * * 1'
workflow_dispatch:
inputs:
release_version:
type: string
description: Which release version to index (type v1.0.6 for example)
default: "latest"
select_index:
type: choice
description: Index as test or live (Live indexes only to live, Test indexes to both)
options:
- Test
- Live
jobs:
update-schemas:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements/shared.txt
sudo apt-get install p7zip-full
- name: Upload and re-index
env:
ES_HOST: ${{ secrets.ES_HOST }}
ES_USER: ${{ secrets.ES_USER }}
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_INDEX_TEST: ${{ secrets.ES_INDEX_TEST }}
ES_INDEX_LIVE: ${{ secrets.ES_INDEX_LIVE }}
run: |
if [[ ${{ github.event.inputs.select_index }} == "Live" ]]; then
echo "Uploading and indexing to Live."
python -u scripts/update_schemas.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.inputs.release_version }} ${{ secrets.ES_INDEX_LIVE }}
else
echo "Uploading and indexing to Test and Live."
python -u scripts/update_schemas.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.inputs.release_version }} ${{ secrets.ES_INDEX_TEST }}
fi