Skip to content

Generate Reports #42

Generate Reports

Generate Reports #42

name: Generate Reports
on:
schedule:
- cron: '* 03 * * *'
workflow_dispatch:
env:
LOG_FILE: 'report.log'
jobs:
generate-reports:
runs-on: ubuntu-latest
strategy:
matrix:
Dataset: [bkm-book-dataset, kitap-yurdu-dataset]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.10.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pandas kaggle
- name: Kaggle Dataset Dawnload
env:
KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }}
run: |
python Scripts/dataset_download.py --dataset_name furkanzeki/${{matrix.Dataset}}
- name: Generate Report
run: |
python Scripts/report.py
- name: Wait before commit and push
run: |
sleep $(( $RANDOM % 60 + 30 ))
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git pull origin main
git add Report/
git commit -m "Add Report File"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}