astro-site-template
Astro starter template for building and deploying sites to Cloudflare Pages.
Last synced:
Template metadata
README
mysite
An Astro site deployed to Cloudflare Pages.
Stack
- Astro — SSR via Cloudflare Workers
- Tailwind CSS v4
- oxlint — linting
- oxfmt — formatting
- vitest — testing
- Cloudflare Pages — hosting
Getting Started from Template
- Click "Use this template" on GitHub to create your repo
- Clone your new repo
- Replace placeholders:
# Update wrangler.toml — change "mysite" to your project name # Update package.json — change "astro-site-template" to your project name # Update README.md — replace YOUR_USERNAME, write your own description - Set up Cloudflare Pages secrets in GitHub repo settings:
CLOUDFLARE_API_TOKEN— API token with Pages edit permissionCLOUDFLARE_ACCOUNT_ID— your Cloudflare account ID
- Install dependencies and start developing:
pnpm install pnpm dev
Development
pnpm dev # Start dev server
pnpm build # Build for production
pnpm preview # Preview production build locally
Testing
pnpm test # Run tests once
pnpm test:watch # Run tests in watch mode
Linting & Formatting
pnpm lint # Lint with oxlint
pnpm format # Format with oxfmt
pnpm format:check # Check formatting (CI uses this)
Deployment
Deployment happens automatically on push to main via the Cloudflare Pages deploy workflow.
To deploy manually:
pnpm build
pnpm wrangler pages deploy dist --project-name=mysite