Fetch, Transform, Train, and Predict #153
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: Fetch, Transform, Train, and Predict | |
on: | |
schedule: | |
- cron: '0 6 * * *' # Runs daily at 11 AM UTC+5 (6 AM UTC) | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas statsmodels joblib requests plotly | |
- name: Fetch weather data | |
run: | | |
python scripts/fetch_weather_data.py | |
- name: Transform data | |
run: | | |
python scripts/transform_data.py | |
- name: Train model | |
run: | | |
python scripts/train_model.py | |
- name: Inference | |
run: | | |
python scripts/inference.py | |
- name: Commit and push changes | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add data/raw/weather_data.json data/processed/processed_data.csv data/models/arima_model.pkl data/processed/predictions.csv | |
git commit -m 'Update data, model, and predictions' | |
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/khurshiduktamov/aqi-prediction-app.git |