Skip to content

.github/workflows/main.yml #336

.github/workflows/main.yml

.github/workflows/main.yml #336

Workflow file for this run

on:
schedule:
# Every day at 8 PM AEST
- cron: '0 10 * * *'
# allow manual workflow trigger
workflow_dispatch:
# required to push back to GitHub
permissions:
contents: write
jobs:
update_data:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3.3.0
- name: setup python
uses: actions/setup-python@v4.5.0
with:
python-version: '>=3.10'
cache: pip
- name: install requirements
run: |
pip install -r requirements.txt
- name: get data
run: |
python get_data.py
- name: push data back to repository
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
# Only push if the return value of git commit is success (0).
if git commit -m "Update data";
then
git push
fi