automation #19
This file contains hidden or 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: automation | |
| on: | |
| schedule: | |
| # The original '0 0 10 * *' ran once a month. | |
| - cron: '0 0 10 * *' | |
| workflow_dispatch: # Allows you to run it manually | |
| # Required permissions for the built-in GITHUB_TOKEN to push changes | |
| permissions: | |
| contents: write | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out this repo | |
| # This action automatically uses the properly-permissioned GITHUB_TOKEN | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install necessary packages | |
| run: | | |
| # Note: sudo apt-get can be slow. If possible, manage dependencies | |
| # with Python's pip where you can. | |
| sudo apt-get update | |
| sudo apt-get install -y chromium-browser | |
| pip install requests beautifulsoup4 pandas webdriver-manager selenium | |
| - name: Run the scraping script | |
| run: python scraper.py | |
| - name: Commit and push changes | |
| # This action will automatically commit and push any new or modified files | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Automated data scrape" |