Refresh vocabulary tables #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Refresh vocabulary tables | |
on: | |
schedule: | |
# - cron: '0 0 * * 0' # weekly, sunday 12am | |
- cron: '0 6 * * *' # every day 6am GMT (1-2am EST/EDT) | |
workflow_dispatch: | |
jobs: | |
refresh-vocab-tables: | |
runs-on: ubuntu-latest | |
# fail-fast: At least shows "Error: Process completed with exit code 143." instead of "exit code 1", for slightly more information about unexpected exits: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#handling-failures | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Set up Python version | |
uses: actions/setup-python@v2 | |
with: | |
# Consider '3.10' or 'v3.10.0': https://github.com/actions/setup-python/issues/160 | |
python-version: '3.9' | |
- name: Print commit hash & branch for rollbacks & troubleshooting | |
run: | | |
echo "Commit hash: ${{ github.sha }}" | |
echo "Branch: ${{ github.ref }}" | |
- name: 'Create env file' | |
run: | | |
mkdir env | |
echo "${{ secrets.ENV_FILE }}" > env/.env | |
- name: Create and start virtual environment | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade wheel | |
pip install --upgrade setuptools | |
pip install -r requirements.txt | |
- name: Refresh vocab | |
run: | | |
python backend/db/refresh_dataset_group_tables.py --dataset-group vocab |