Update Graphs #230
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 Graphs | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # Runs every day at midnight | |
jobs: | |
update: | |
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.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run web scraping script | |
run: python scrape_essays.py | |
- name: Run visualization script | |
run: python visualize_wc.py | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
# Check for changes | |
if git diff --exit-code; then | |
echo "No changes to commit" | |
else | |
git commit -am "Update graphs with latest data" | |
git push | |
fi |