Skip to content

Keep "Plugin of the day" current: daily Pages build plus a browser fallback - #2

Open
Que2039 wants to merge 1 commit into
mainfrom
cursor/daily-plugin-of-the-day-8a38
Open

Que2039 wants to merge 1 commit into
mainfrom
cursor/daily-plugin-of-the-day-8a38

Conversation

@Que2039

@Que2039 Que2039 commented Dec 2, 2026

Copy link
Copy Markdown

The start page's plugin of the day is picked at build time (pickOf in scripts/model.mjs). The Pages workflow only ran on push and manual dispatch, and it never built: it uploaded the committed site/. So the live page kept the date of the last local build (30 Nov while it was 2 Dec).

Changes

  • .github/workflows/pages.yml: adds a daily schedule (7 0 * * *, 00:07 UTC). On every run (push, schedule or dispatch), it runs npm ci and node scripts/build.mjs --pages --no-share-images before uploading site/.
  • The pages-only build can now run in CI:
    • The new --no-share-images flag skips the share images, so it needs no Playwright or Chrome.
    • When ../native-nxs isn't next to the repo, the local devices take their asset from the last build (site/play/build.json), and presetState returns nothing (only the device builds use it).
    • With A_PLUGINS_DATE=2026-11-30, this build reproduces the committed site/ byte for byte.
  • Browser fallback, for when a scheduled run is late or fails: a small inline script on the start page uses the same seeded turn as pickOf. If the page is older than its UTC build day, the false date becomes "Featured plugin", and the script adds "Plugin of the day, : →". That link is a data-spa link, so clicking it plays today's pick in the player without a reload.
  • Regenerated site/ for 2 Dec 2026. Device pages change only in the a-plugins.css?v= hash. sitemap.xml lastmod now moves with the daily build.

How to confirm it works

  1. After merging, open Actions → "Publish website" and click "Run workflow" (or wait for 00:07 UTC). The run should pass the build.mjs --pages step and deploy.
  2. On the live start page, the eyebrow reads "Plugin of the day · <today's UTC date>", and the response's last-modified is from that run.
  3. To check the fallback, run npm ci && A_PLUGINS_DATE=2026-11-01 node scripts/build.mjs --pages --no-share-images && npm run serve and open http://127.0.0.1:8095. The eyebrow should say "Featured plugin", with "Plugin of the day, : →" under the buttons. Clicking it loads that device. Afterwards, discard the local build with git checkout site.
  4. The next morning, Actions shows a scheduled run. GitHub can delay scheduled runs, and the fallback covers that gap.
Open in Web Open in Cursor 

…:07 UTC), and pick again in the browser when the start page is older than a day

The workflow now runs build.mjs --pages --no-share-images before deploying, which works without the sibling native-nxs and Plugin_Test checkouts: local devices fall back to the asset of the last build (site/play/build.json).

Co-authored-by: David Querg <Que2039@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants