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:
1 parent
98541c5cf0
commit
45766b31d1
1 file changed
+5
-3
@@ -6,7 +6,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
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:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -37,12 +37,14 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CHROME_FLAGS: "--no-sandbox --disable-dev-shm-usage --disable-gpu"
|
CHROME_FLAGS: "--no-sandbox --disable-dev-shm-usage --disable-gpu"
|
||||||
run: sh tools/shots.sh
|
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
|
- name: commit
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
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
|
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
|
git push -q origin HEAD:main
|
||||||
- name: tell Teahub pages to pull
|
- 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"
|
run: curl -fsS -X POST "https://gandora.yolopreneur.lol/_hook/gandora/site" || echo "pages pulls by itself within five minutes"
|
||||||
Reference in new issue
Block a user