Scraper #397
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: Scraper | |
on: | |
schedule: | |
- cron: '0 3 * * *' # 3 o'clock UTC daily | |
workflow_dispatch: | |
jobs: | |
scraping: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install python module | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run scraper | |
run: chmod +x run.sh && ./run.sh | |
- name: Commit result | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add data/product*json | |
timestamp=$(TZ='Asia/Jakarta' date +'%a, %F at %H:%M %Z') | |
git commit -m "Updated: ${timestamp}" || exit 0 | |
git push | |