Skip to content

Generate Stats and Deploy #98

Generate Stats and Deploy

Generate Stats and Deploy #98

Workflow file for this run

name: Generate Stats and Deploy
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch: # Allows you to run it manually from the Actions tab
push:
branches:
- main # Runs whenever you update the code on main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to push to gh-pages branch
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Run Python Data Fetcher
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python fetch_stats.py
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./