Update OpenChallenges DB files #386
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: Update OpenChallenges DB files | |
on: | |
schedule: | |
- cron: '0 0 * * *' # daily at 00:00 UTC | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
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: Get current date | |
run: | | |
echo "TODAY=$(date +"%Y-%m-%d")" >> $GITHUB_ENV | |
- name: Push changes, then create or update pull request | |
uses: peter-evans/[email protected] | |
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 |