No description
  • JavaScript 54.9%
  • Svelte 33.5%
  • HTML 7.7%
  • TypeScript 3.9%
Find a file Use this template
Stephen Way 68ff4e41b7
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Has been skipped
CI / build (push) Successful in 37s
Add eslint + prettier + CI lint (#1)
2026-06-24 21:35:30 +00:00
.github/workflows Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
scripts Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
src Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
.gitignore Scaffold SvelteKit Cloudflare Pages template 2026-06-23 06:38:31 +00:00
.prettierignore Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
eslint.config.js Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
package.json Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
pnpm-lock.yaml Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
prettier.config.js Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
README.md Scaffold SvelteKit Cloudflare Pages template 2026-06-23 06:38:31 +00:00
svelte.config.js Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
tsconfig.json Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00
vite.config.ts Add eslint + prettier + CI lint (#1) 2026-06-24 21:35:30 +00:00

SvelteKit Cloudflare Pages Template

Minimal SvelteKit starter for Cloudflare Pages with production deploys, per-PR preview deploys, sticky preview comments, and preview cleanup workflows.

Use This Template

  1. Create a new repository from this template.
  2. Create a Cloudflare Pages project. Its name must match the CLOUDFLARE_PROJECT_NAME repository variable.
  3. Configure repository Actions variables:
    • CLOUDFLARE_ACCOUNT_ID: your Cloudflare account ID.
    • CLOUDFLARE_PROJECT_NAME: your Cloudflare Pages project name.
  4. Configure repository Actions secrets:
    • CLOUDFLARE_API_TOKEN: a Cloudflare API token with Pages edit access for the project.

The Forgejo or GitHub runner token is provided automatically as GITHUB_TOKEN; it is used for preview PR comments.

Commands

pnpm install
pnpm dev
pnpm build
pnpm check

The build uses @sveltejs/adapter-cloudflare, then copies the adapter output to build because the included workflows deploy that directory with Wrangler.

Workflows

  • CI: installs dependencies, builds the app, and runs Svelte checks on pushes to main and pull requests.
  • Deploy to Cloudflare Pages: deploys main to production when CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_PROJECT_NAME, and CLOUDFLARE_API_TOKEN are configured.
  • Preview deploy: opens or updates a Cloudflare Pages preview deployment for each same-repository pull request, then posts or updates a sticky PR comment with the preview URL.
  • Preview cleanup: deletes a PR preview when the PR closes, updates the sticky comment, and includes a manual workflow_dispatch sweep for orphaned preview deployments.

Push to main for a production deploy. Open a pull request for a preview deploy. Close a pull request to remove its preview. Run the manual Preview cleanup workflow to sweep orphaned previews.

External Actions

The workflows depend on these external actions:

  • https://rasterhub.com/rasterstate/setup-node-action@v1
  • https://rasterhub.com/rasterstate/setup-pnpm-action@v1

Project Files

  • src/routes/+page.svelte: placeholder landing page.
  • svelte.config.js: SvelteKit configured with @sveltejs/adapter-cloudflare.
  • .github/workflows/: CI, production deploy, preview deploy, and preview cleanup workflows.