Scrape #58
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 | |
on: | |
schedule: | |
- cron: "0 0 1 * *" | |
workflow_dispatch: | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
jobs: | |
scrape-latest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set locale | |
run: | | |
sudo apt-get install -y locales | |
sudo locale-gen pt_PT.UTF-8 | |
export LC_ALL=pt_PT.UTF-8 | |
export LANG=pt_PT.UTF-8 | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install requirements | |
run: pip3 install -r requirements.txt | |
- name: Setup Geckodriver | |
uses: browser-actions/setup-geckodriver@v0.0.0 | |
- name: Run nfg_scrape.py | |
env: | |
KEY_GOIANA: ${{ secrets.KEY_GOIANA }} | |
run: python src/data/nfg_scrape.py | |
- name: Run arrecadacao_scrape.py | |
run: python src/data/arrecadacao_scrape.py | |
- name: Commit changes | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "action@github.com" | |
git add -A | |
git diff --quiet && git diff --staged --quiet || git commit -am "new scraped data" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |