From 46df5d1f1448ecd99161543742d3f99ba7c208f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:31:26 +0000 Subject: [PATCH 1/3] Initial plan From 60c280c2914d0b4125d4afc344b643634e5b3e27 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:34:54 +0000 Subject: [PATCH 2/3] Add commit-hash cache busting for PWA service worker Agent-Logs-Url: https://github.com/rorpage/autoplay/sessions/db738686-2743-45f2-8b83-bd2d084d9fc5 Co-authored-by: rorpage <1423093+rorpage@users.noreply.github.com> --- .github/workflows/deploy.yml | 42 ++++++++++++++++++++++++++++++++++++ sw.js | 10 ++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a8295f2 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Deploy + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Inject commit hash into service worker + run: | + COMMIT_HASH=$(git rev-parse --short HEAD) + sed -i "s/__COMMIT_HASH__/${COMMIT_HASH}/g" sw.js + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: . + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/sw.js b/sw.js index b639469..a1057f7 100644 --- a/sw.js +++ b/sw.js @@ -1,10 +1,18 @@ -const CACHE_NAME = 'states-tracker-v1'; +const CACHE_NAME = 'states-tracker-__COMMIT_HASH__'; const ASSETS = ['/', '/index.html', '/styles.css', '/app.js', '/manifest.json', '/IN.svg']; self.addEventListener('install', e => { e.waitUntil(caches.open(CACHE_NAME).then(cache => cache.addAll(ASSETS))); }); +self.addEventListener('activate', e => { + e.waitUntil( + caches.keys().then(keys => + Promise.all(keys.filter(key => key !== CACHE_NAME).map(key => caches.delete(key))) + ) + ); +}); + self.addEventListener('fetch', e => { e.respondWith( caches.match(e.request).then(cached => cached || fetch(e.request)) From 91d813aaecd39706e920a9407e1c9dda604d93b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:46:25 +0000 Subject: [PATCH 3/3] Replace GitHub Actions deploy with Vercel build-step cache busting Agent-Logs-Url: https://github.com/rorpage/autoplay/sessions/89aa106e-78f3-4217-a9de-ab3c6ebeb486 Co-authored-by: rorpage <1423093+rorpage@users.noreply.github.com> --- .github/workflows/deploy.yml | 42 ------------------------------------ vercel.json | 4 ++++ 2 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 vercel.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index a8295f2..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Deploy - -on: - push: - branches: - - main - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: pages - cancel-in-progress: false - -jobs: - deploy: - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Inject commit hash into service worker - run: | - COMMIT_HASH=$(git rev-parse --short HEAD) - sed -i "s/__COMMIT_HASH__/${COMMIT_HASH}/g" sw.js - - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: . - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..4782706 --- /dev/null +++ b/vercel.json @@ -0,0 +1,4 @@ +{ + "buildCommand": "bash -c \"sed -i 's/__COMMIT_HASH__/'${VERCEL_GIT_COMMIT_SHA:0:7}'/g' sw.js\"", + "outputDirectory": "." +}