diff --git a/.gitea/workflows/shots.yml b/.gitea/workflows/shots.yml index 2fccb31..c8321ad 100644 --- a/.gitea/workflows/shots.yml +++ b/.gitea/workflows/shots.yml @@ -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"