Scrape and commit #1827
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
# This workflow scrapes the latest show episodes and commits the new episode and data | |
# files to the repo. | |
name: Scrape and commit | |
on: | |
schedule: | |
- cron: '0 0,12 * * *' # At midnight & noon UTC | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout jupiterbroadcasting.com' | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
path: ./jbsite | |
- name: 'Checkout show-scraper' | |
uses: actions/checkout@v3 | |
with: | |
repository: JupiterBroadcasting/show-scraper | |
ref: main | |
path: ./show-scraper | |
- name: 'Setup Python' | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
architecture: 'x64' | |
cache: "pipenv" | |
- name: 'Install Python deps' | |
run: pip install pipenv && cd ./show-scraper && pipenv sync --bare | |
- name: 'Scrape' | |
run: | | |
cd ./show-scraper | |
DATA_DIR=../jbsite LATEST_ONLY=true pipenv run ./scraper.py | |
- name: 'Commit' | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'Automatically scraped and committed via a GitHub Action.' | |
repository: ./jbsite |