Skip to content

Merge pull request #20 from 16bravo/bugfix/corrections_yaml_v2 #18

Merge pull request #20 from 16bravo/bugfix/corrections_yaml_v2

Merge pull request #20 from 16bravo/bugfix/corrections_yaml_v2 #18

Workflow file for this run

name: DB Initialisation
on:
push:
branches:
- main
jobs:
init_db:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Vérifier l'existence de la base de données
id: check-db
run: |
if [ -f data/BranvoRanking.db ]; then
echo "Database exists already. No need for init."
echo "::set-output name=init_required::false"
else
echo "Database does not exist. Init needed."
echo "::set-output name=init_required::true"
fi
- name: Install dependencies
if: steps.check-db.outputs.init_required == 'true'
run: pip install -r requirements.txt
- name: Create .kaggle directory
if: steps.check-db.outputs.init_required == 'true'
run: mkdir -p /home/runner/.kaggle
- name: Set up Kaggle credentials
if: steps.check-db.outputs.init_required == 'true'
run: echo "$KAGGLE_JSON" > /home/runner/.kaggle/kaggle.json && chmod 600 /home/runner/.kaggle/kaggle.json
env:
KAGGLE_JSON: ${{ secrets.KAGGLE_JSON }}
- name: Run initialization script
if: steps.check-db.outputs.init_required == 'true'
run: python scripts/db_initialisation.py