forked from Sage-Bionetworks/sage-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.79 KB
/
update-oc-db-csv-files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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)
labels: sonar-scan-approved
commit-message: "${{ env.TODAY }}: add latest CSV dump files"
branch: openchallenges/db-update