Daily Run #310
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: Daily Run | |
on: | |
schedule: | |
- cron: '40 11 * * *' # Runs every day at 6:40 AM EST (11:40 UTC) | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
- name: Update system dependencies | |
run: sudo apt-get update | |
- name: Remove Chrome | |
run: sudo apt purge google-chrome-stable | |
- name: Install Google Chrome | |
# Make sure google-chrome-stable_current_amd64.deb is in .gitignore to avoid cluttering the repo | |
run: | | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo apt install ./google-chrome-stable_current_amd64.deb | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
- name: Run script | |
run: python run_scraper.py | |
- name: Configure git | |
run: | | |
git config --global user.email "actions-user@users.noreply.github.com" | |
git config --global user.name "GitHub Actions" | |
- name: Commit changes | |
env: | |
TZ: America/New_York | |
run: | | |
CURRENT_DATE=$(date +"%m/%d/%Y") | |
git add . | |
git commit -m "run ($CURRENT_DATE)" -a || echo "No changes to commit" | |
git push |