.github/workflows/check.yaml #43
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
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: "0 0 * * 0" # weekly | |
jobs: | |
check-html: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
- name: Set up Python environment | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Grab data | |
run: python grab.py | |
- name: Process data and make map | |
run: python process.py | |
- name: Check for Changes | |
id: git-check | |
run: | | |
git diff --exit-code output/ || echo "git-diff-exit-code=$?" >> $GITHUB_ENV | |
continue-on-error: true | |
- name: Configure Git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Commit and Push Output | |
if: env.git-diff-exit-code == '1' | |
run: | | |
git add output/ | |
git commit -m "Add output from GitHub Action" | |
git push | |