Skip to content

Update OpenChallenges DB files #352

Update OpenChallenges DB files

Update OpenChallenges DB files #352

name: Update OpenChallenges DB files
on:
schedule:
- cron: '0 0 * * *' # daily at 00:00 UTC
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
# schematic only supports Python 3.9 and 3.10, so we will need
# to specifically use one of these versions.
- name: Install system dependencies
run: |
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y pip python3.10-venv libcurl4-openssl-dev
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
fetch-depth: 0
- name: Create Google Client credentials file
uses: jsdaniell/[email protected]
with:
name: 'service_account.json'
json: ${{ secrets.GOOGLE_CLIENT_JSON }}
- name: Update dump files
run: |
python3 -m pip install --upgrade pip
pip install gspread pandas numpy
python3 apps/openchallenges/db-update/update_db_csv.py
# - name: Install schematic and validate files
# shell: bash
# run: |
# python3.10 -m venv .venv
# chmod 755 .venv/bin/activate
# source .venv/bin/activate
# pip3.10 install schematicpy
- name: Get current date
run: |
echo "TODAY=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
- name: Push changes, then create or update pull request
uses: peter-evans/create-pull-request@v6
with:
title: 'chore(openchallenges): ${{ env.TODAY }} DB update'
body: Daily OC database update(s)
commit-message: '${{ env.TODAY }}: add latest CSV dump files'
branch: openchallenges/db-update