Scrape and upload #855
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: Scrape and upload | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 */6 * * * | |
jobs: | |
run: | |
name: Run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: setup-python | |
name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pipenv' | |
- id: install-pipenv | |
name: Install pipenv | |
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python | |
shell: bash | |
- id: install-python-dependencies | |
name: Install Python dependencies | |
run: pipenv install --python=`which python` | |
shell: bash | |
- id: scrape-and-upload | |
name: Scrape and upload | |
run: pipenv run python -m src.scrape | |
shell: bash | |
env: | |
DOCUMENTCLOUD_USER: ${{ secrets.DOCUMENTCLOUD_USER }} | |
DOCUMENTCLOUD_PASSWORD: ${{ secrets.DOCUMENTCLOUD_PASSWORD }} | |
DOCUMENTCLOUD_PROJECT_ID: ${{ secrets.DOCUMENTCLOUD_PROJECT_ID }} | |
- id: commit | |
name: Commit | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git config pull.rebase false | |
git pull origin $GITHUB_REF | |
git add ./pdfs | |
git commit -m "Added latest PDF" --author="palewire <palewire@users.noreply.github.com>" && git push || true | |
shell: bash |