Skip to content

feat: add Astro website with cached Cloudflare download redirects - #38

Merged
fython merged 4 commits into
mainfrom
feat/wheelplay-website
Oct 23, 2026
Merged

fython merged 4 commits into
mainfrom
feat/wheelplay-website

Conversation

@fython

@fython fython commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add a Chinese WheelPlay product website in website/, built with Astro static generation and deployable to Cloudflare Pages or Workers Static Assets. Visitors can explore responsive product illustrations, setup instructions, and FAQs, switch themes, and download the latest development build.

The download button now opens /download. A shared Worker/Pages Function resolves the newest successful main run of debug-build.yml, selects its unexpired wheelplay-debug-apk artifact, and returns a 302 to https://github.com/fython/wheelplay/actions/runs/{run_id}/artifacts/{artifact_id}. Only GitHub metadata is fetched; artifact files are never proxied. Missing artifacts return 404 without falling back to an older run; API failures return 503 with a workflow link and Retry-After.

  • Cache successful resolutions for up to five minutes, bounded by artifact expiry, using isolate memory and Cloudflare Cache API. Coalesce concurrent lookups within an isolate and ignore query strings/cookies/client cache headers in cache keys.
  • Cache failures for at least 60 seconds and honor GitHub rate-limit backoff up to one hour. A normal cold lookup uses two bounded API requests with five-second timeouts and no immediate retries. Cache storage is per data center; concurrency coalescing is per isolate.
  • Route only download paths through the function. Other static assets are served directly. Optional GITHUB_TOKEN stays in Cloudflare secrets and is never included in HTML, redirects, or caches.
  • Use shared Astro layouts/components, external bundled scripts/styles compatible with the CSP, existing project branding, accessible interactive illustrations, and a custom 404 page.
  • Author the on-site user guide and FAQ as native Markdown pages under website/src/pages/docs/. Shared layout handles navigation, metadata, automatic heading links, light/dark themes, and responsive typography. Homepage documentation links open these pages; future content edits require no Astro/HTML changes. Disable inline code-highlighting styles to preserve the CSP.
  • Add independent Node.js 24 website CI, reproducible dependencies, production artifact checks, and download/cache tests. Document local development and both Cloudflare deployment options in website/README.md.

Validation

  • Astro check passed with no errors, warnings, or hints; static build and five production artifact/CSP tests passed, including both Markdown pages and their table-of-contents targets.
  • All 22 download tests passed, covering build/artifact selection, expiry, memory/edge caches, concurrent requests, negative caching, rate limits, timeouts, unexpected API redirects, and method/path handling.
  • Compiled Workers and Pages Functions both passed real workerd runtime checks with mocked GitHub metadata: concurrent GET/HEAD requests redirect correctly with only two upstream calls, no artifact proxying, and static assets still resolve.
  • Wrangler Workers deployment dry-run and Pages Functions compilation passed; git diff --check passed.
  • Website browser checks covered widths from 320 to 1440 px, keyboard navigation, themes, FAQs, disabled storage, no JavaScript, bundled assets, Astro live updates, and Cloudflare CSP/404 behavior. Both Markdown pages additionally passed checks at 320, 390, 768, and 1440 px, including navigation, heading links, persistent themes, no JavaScript, and no browser errors.

Deployment notes

No Cloudflare deployment or online CPU benchmark has been performed. GitHub responses in resolver/runtime tests are mocked; live GitHub API access was unavailable in the execution environment. Production deployments can configure a fine-grained GITHUB_TOKEN with Actions read permission to increase API limits. Downloading artifacts may require GitHub login.

Astro's dist/ contains static assets only; deploy from the repository so Wrangler/Pages includes the Worker or Functions source. Android application code is unchanged.

@fython fython changed the title feat: add WheelPlay website with Cloudflare deployment support feat: add Astro-based WheelPlay website with Cloudflare deployment support Oct 23, 2026
@fython fython changed the title feat: add Astro-based WheelPlay website with Cloudflare deployment support feat: add Astro website with cached Cloudflare download redirects Oct 23, 2026
@fython
fython merged commit 39b3e81 into main Oct 23, 2026
3 checks passed
@fython
fython deleted the feat/wheelplay-website branch October 23, 2026 13:10
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