Skip to content

Update data

Update data #583

Workflow file for this run

# SPDX-FileCopyrightText: 2021 Stephan Druskat <[email protected]>
# SPDX-License-Identifier: CC0-1.0
name: Update data
on:
schedule:
- cron: "0 22 * * *" #runs at 22:00 UTC everyday
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up cache
uses: actions/cache@master
id: cache
with:
path: ${{ env.pythonLocation}}/lib/python3.8/site-packages/*
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Python requirements
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Update the file count
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if run.py requires passwords..etc, set it as secrets
run: |
python query_api.py
python clean_plot.py
cat current_count.txt
- name: Commit updated files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Update data"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main