Update Static Files #256
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: Update Static Files | |
on: | |
schedule: | |
- cron: '0 */6 * * *' # Runs every 6 hours | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update_static: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Generate static files | |
env: | |
OPENWEATHERMAP_API_KEY: ${{ secrets.OPENWEATHERMAP_API_KEY || '' }} | |
run: | | |
python generate_static.py | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build |