Skip to content

Update Mod and website Data #772

Update Mod and website Data

Update Mod and website Data #772

Workflow file for this run

name: Update Mod and website Data
on:
schedule:
- cron: "0 * * * *"
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
update-mod-and-website-data:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Fetch mod data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python fetch_mods.py
- name: Publish site and data to html branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -B html
git add -A
if git diff --cached --quiet; then
echo "No changes to publish."
else
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
git commit -m "chore: publish site and mod data [${TIMESTAMP}]"
fi
git push origin html --force