Update data and webpage #534
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 data and webpage | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '*/15 00 * * *' | |
workflow_dispatch: | |
jobs: | |
update-webpage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run script | |
run: python main.py | |
- name: Evil Git branches hack | |
run: | | |
git fetch origin gh-pages | |
mv index.html .. | |
git switch gh-pages | |
mv ../index.html . | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update dataset and webpage | |
commit_user_name: GitHub Actions | |
commit_user_email: actions@github.com | |
commit_author: GitHub Actions <actions@github.com> | |
branch: gh-pages | |
file_pattern: index.html |