Skip to content

Update Website Data #284

Update Website Data

Update Website Data #284

name: Update Website Data
on:
schedule:
- cron: "0 17 * * 1,4"
workflow_dispatch:
jobs:
update-website:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run script
id: run-script
run: |
output=$(python .github/scripts/check_database.py)
echo "Output [$output]"
echo "no_error=$output" >> $GITHUB_OUTPUT
- name: create an issue
if: steps.run-script.outputs.no_error != ''
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: Exception during database update
body: |
### Context
[Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Exception - `${{steps.run-script.outputs.no_error}}`
- name: Today Date
id: today_date
run: |
date=$(date -u +"%Y-%m-%d")
echo $date
echo "date=$date" >> $GITHUB_OUTPUT
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v4.16.0
with:
commit_message: Database updated - ${{steps.today_date.outputs.date}}