ci: nightly feed, stats, and entropy refresh; fix: snake workflow

This commit is contained in:
developtheweb 2026-07-07 21:58:06 -04:00
parent 3ebe545f10
commit fe0a9ebff7
3 changed files with 251 additions and 8 deletions

37
.github/workflows/nightly.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Nightly Telemetry
on:
schedule:
- cron: "17 6 * * *"
workflow_dispatch:
concurrency:
group: demon-state
cancel-in-progress: false
permissions:
contents: write
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Refresh feed, stats, featured cards, entropy field
env:
GITHUB_TOKEN: ${{ github.token }}
run: python3 engine/nightly.py
- name: Commit if changed
run: |
if git diff --quiet; then
echo "no changes"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898470+github-actions[bot]@users.noreply.github.com"
git add README.md state/demon.json assets/entropy.svg
git commit -m "chore: nightly telemetry refresh"
git pull --rebase origin "${GITHUB_REF_NAME}"
git push

View file

@ -4,19 +4,15 @@ on:
schedule:
# Runs every 12 hours
- cron: "0 */12 * * *"
workflow_dispatch:
push:
branches:
- main
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate Snake
uses: Platane/snk/svg-only@v3
@ -25,11 +21,11 @@ jobs:
outputs: |
dist/github-contribution-grid-snake.svg
dist/github-contribution-grid-snake-dark.svg?palette=github-dark
- name: Push to output branch
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}