Skip to content

DAILY WEATHER REPORT ACTION #1011

DAILY WEATHER REPORT ACTION

DAILY WEATHER REPORT ACTION #1011

name: DAILY WEATHER REPORT ACTION
on:
schedule:
- cron: '0 08 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo content
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v4 # Updated to v4
with:
python-version: '3.12' # Specify exact version
cache: 'pip' # Enable pip caching
- name: Install python packages
run: |
python -m pip install --upgrade pip
python -m pip install requests pandas pillow regex
python -m pip install -r requirements.txt
- name: Test API endpoints
run: |
curl -v https://bot.fogos.pt/ipma.php
curl -v https://api.fogos.pt/v2/weather/stations?id=1200843
curl -v https://api.fogos.pt/v1/weather/stations?id=1200843
- name: Run App with debug logging
env:
PYTHONUNBUFFERED: 1
LOG_LEVEL: DEBUG
run: |
python -c "
import logging
logging.basicConfig(level=logging.DEBUG)
import requests
r = requests.get('https://bot.fogos.pt/ipma.php')
print(f'Status: {r.status_code}')
print(f'Headers: {r.headers}')
print(f'Content: {r.text[:500]}')"
python app.py
- name: Check generated files
run: |
ls -la *.png
file *.png
- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: DAILY WEATHER REPORT SCRAPPING SUCCESSFUL
branch: ${{ github.head_ref }}