Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .github/workflows/dsc-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Temporary DSC Cloudflare Pages deploy
on:
workflow_dispatch:
inputs:
dsc_sha:
description: Exact DSC commit represented by the bundled production build
required: true
type: string
default: 87e4be3f961aa41498ac5e6e36cd1fe39a9afe2b
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Confirm artifact commit
run: test "${{ inputs.dsc_sha }}" = "87e4be3f961aa41498ac5e6e36cd1fe39a9afe2b"
- name: Deploy DSC to Cloudflare Pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: npx --yes wrangler@4.166.0 pages deploy dsc-dist --project-name dsc-commerce-storefront --branch main
3 changes: 3 additions & 0 deletions dsc-dist/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Static assets
# - PWA icons
# - favicon.ico
57 changes: 57 additions & 0 deletions dsc-dist/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Cloudflare Pages Headers Configuration
# Cache headers for static assets

# Cache static assets aggressively
/assets/*
Cache-Control: public, max-age=31536000, immutable
X-Content-Type-Options: nosniff

# Cache HTML (no cache by default, can be changed for static hosting)
/*
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
Permissions-Policy: camera=(), microphone=(), geolocation=()
# same-origin-allow-popups: PayPal/social popups need window.opener
# across origins; strict same-origin would isolate them.
Cross-Origin-Opener-Policy: same-origin-allow-popups
# Our own assets load same-site; cross-site embedding of them is not a
# use case (email images are served by the media domain, not Pages).
Cross-Origin-Resource-Policy: same-site
# script-src deliberately has no 'unsafe-inline': nothing injects an
# executable inline script (the JSON-LD block is a data block — CSP-exempt;
# Plausible/Meta load external allowlisted srcs; Vite emits external
# module scripts).
# img-src additionally allows images.unsplash.com: the mock catalog's
# image URLs point there (the API serves them inside product/category
# payloads). Interim until real photography ships through the media
# pipeline and the API payloads are repointed to the media domain.
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.paypal.com https://www.paypal.com https://api.darksidecrafts.com https://plausible.io https://connect.facebook.net; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob: https://media.darksidecrafts.com https://images.unsplash.com; connect-src 'self' https://api.darksidecrafts.com https://*.sentry.io https://plausible.io https://*.paypal.com https://*.paypalobjects.com https://www.paypal.com https://www.facebook.com; frame-src https://*.paypal.com https://*.paypalobjects.com https://www.paypal.com https://www.instagram.com https://www.youtube.com https://player.vimeo.com https://www.facebook.com https://www.tiktok.com; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'

# Cache manifest and service worker
/manifest.webmanifest
Cache-Control: public, max-age=86400
Content-Type: application/manifest+json

/sw.js
Cache-Control: public, max-age=0, must-revalidate
Service-Worker-Allowed: /

# Image caching
/images/*
Cache-Control: public, max-age=604800
X-Content-Type-Options: nosniff

# Font caching
/fonts/*
Cache-Control: public, max-age=31536000, immutable

# API calls - no cache
/api/*
Cache-Control: no-cache, no-store, must-revalidate
X-Content-Type-Options: nosniff

# Static JSON data
/data/*
Cache-Control: public, max-age=3600
15 changes: 15 additions & 0 deletions dsc-dist/_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": 1,
"include": [
"/products/*",
"/blog/*",
"/privacy",
"/terms",
"/shipping",
"/returns",
"/faq",
"/robots.txt",
"/AGENTS.md"
],
"exclude": ["/api/*", "/admin/*", "/sw.js", "/manifest.webmanifest"]
}
1 change: 1 addition & 0 deletions dsc-dist/assets/AI.B8UxxsHF.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dsc-dist/assets/AIProductBuilder.DiA35y0m.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dsc-dist/assets/AboutPage.Dhl6jVxW.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading