Generate Reports #42
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: 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 }} |