Skip to content

Migrate production frontend to Static Web Apps - #440

Merged
NewFuture merged 7 commits into
v2from
copilot/static-web-apps-20260727
Jul 27, 2026
Merged

Migrate production frontend to Static Web Apps#440
NewFuture merged 7 commits into
v2from
copilot/static-web-apps-20260727

Conversation

@NewFuture

@NewFuture NewFuture commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • add Azure Static Web Apps response, cache, MIME, and 404 configuration
  • stage the existing production video and deploy the v2 artifact to the Free sticker Static Web App
  • retire the main integration frontend deployment and remove all Azure Front Door purge/domain dependencies
  • keep Blob $web publishing as an origin-level rollback while Static Web Apps serves production
  • test supported Node 20 and current LTS Node 24 instead of the unbounded non-LTS latest release

Validation

  • deployed 73 files / 23.94 MiB to salmon-sea-01436e000.7.azurestaticapps.net
  • sticker.newfuture.cc is bound to the Static Web App with Azure status Ready
  • verified HTTPS redirect, TLS, custom 404, cache headers, HTML routes, manifest MIME, MP4 MIME, and byte-range 206 responses
  • clean Windows Node 24.18.0 run passed install, both frontend builds, both test suites, formatting, and all five react-snap routes
  • production image domain stickers.newfuture.cc has already moved away from Front Door and returned byte-identical Blob samples

After this PR is merged and the production workflow succeeds, the obsolete stickers-cdn Front Door profile can be deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Azure Static Web Apps (SWA) support for the production frontend by introducing SWA runtime configuration (headers/MIME/404), staging a production video asset during deployment, and extending the existing GitHub Actions CD workflow to also deploy the v2 artifact to the Free sticker SWA (while keeping the current Blob/Front Door path for rollback).

Changes:

  • Add staticwebapp.config.json for SWA caching headers, MIME overrides, and custom 404 handling.
  • Update the website build pipeline to ensure Puppeteer is installed before running react-snap.
  • Extend fe-cd.yml to stage the production MP4 and deploy v2 builds to Azure Static Web Apps using a deployment token fetched at runtime.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
website/public/staticwebapp.config.json Adds SWA config for cache headers, MIME types, and 404 rewrite.
website/package.json Updates snap script to install Puppeteer before running react-snap.
.github/workflows/fe-cd.yml Stages a video file into the deploy artifact and deploys v2 to SWA using an API token fetched via Azure CLI.
Comments suppressed due to low confidence (1)

website/public/staticwebapp.config.json:40

  • This route also uses brace expansion (/*.{html,json,webmanifest,zip}), which isn’t supported by Azure Static Web Apps route matching; the intended caching headers may never be applied for these extensions.
        {
            "route": "/*.{html,json,webmanifest,zip}",
            "headers": {
                "Cache-Control": "public, max-age=604800"
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/public/staticwebapp.config.json
Comment thread .github/workflows/fe-cd.yml Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…em Chrome fallback

When puppeteer's Chrome download fails silently, react-snap previously received
no Chrome binary and failed with ENOENT. The new snap.js:
1. Cleans up stale .local-chromium if binary is missing
2. Tries puppeteer install.js to download Chrome
3. Falls back to system Chrome (google-chrome-stable, etc.) if download fails
4. Runs react-snap as a subprocess with PUPPETEER_EXECUTABLE_PATH set correctly
Stop publishing the retired integration frontend, deploy production only to Blob and Static Web Apps, and pin CI to supported Node LTS releases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NewFuture NewFuture changed the title Deploy production frontend to Static Web Apps Migrate production frontend to Static Web Apps Jul 27, 2026
@NewFuture
NewFuture merged commit 125cccc into v2 Jul 27, 2026
7 checks passed
@NewFuture
NewFuture deleted the copilot/static-web-apps-20260727 branch July 28, 2026 00:36
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.

3 participants