shots workflow: stamp sw.js with the commit and commit it along with the shots

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6897PWcUEwHiqZMcVnNF6
This commit is contained in:
teahubxyzandClaude Fable 5.1 committed 2026-10-21 03:41:06 +00:00
1 parent 98541c5cf0
commit 45766b31d1
1 file changed
+5 -3
+5 -3
View File
@@ -6,7 +6,7 @@ on:
workflow_dispatch:
push:
branches: [main]
paths: [index.html, brain.js, favicon.svg, icons/icon.svg, tools/shots.sh, tools/icons.py]
paths: [index.html, brain.js, favicon.svg, manifest.json, icons/icon.svg, tools/shots.sh, tools/icons.py]
permissions:
contents: write
concurrency:
@@ -37,12 +37,14 @@ jobs:
env:
CHROME_FLAGS: "--no-sandbox --disable-dev-shm-usage --disable-gpu"
run: sh tools/shots.sh
- name: stamp the service worker
run: sed -i "s/^const REV = \".*\";/const REV = \"${GITHUB_SHA::12}\";/" sw.js && grep '^const REV' sw.js
- name: commit
run: |
set -eu
git add shots/desktop.png icons/icon-512.png icons/icon-192.png icons/apple-touch-icon.png
git add shots/desktop.png icons/icon-512.png icons/icon-192.png icons/apple-touch-icon.png sw.js
if git diff --cached --quiet; then echo "shots unchanged"; exit 0; fi
git -c user.name='gitea-actions[bot]' -c user.email='gitea-actions[bot]@users.noreply.teahub.xyz' commit -q -m "shots: desktop.png + icons"
git -c user.name='gitea-actions[bot]' -c user.email='gitea-actions[bot]@users.noreply.teahub.xyz' commit -q -m "shots + sw stamp ${GITHUB_SHA::12}"
git push -q origin HEAD:main
- name: tell Teahub pages to pull
run: curl -fsS -X POST "https://gandora.yolopreneur.lol/_hook/gandora/site" || echo "pages pulls by itself within five minutes"