Your name
Software engineer. Building useful things.
Publish with Cloudflare
Publish this demo with Cloudflare Workers Static Assets. A Cloudflare account and GitHub repository are enough. No custom domain is needed.
-
Push the public application to GitHub
Commit and push the reviewed application files to
main. Cloudflare builds what is on GitHub, so changes saved only on your computer will not appear.Keep
config/site.json,.private/,dist/, anddist-private/Git-ignored. The committedconfig/site.example.jsonprovides the neutral demo. -
Create a Cloudflare Worker
Open the Cloudflare dashboard. Go to Workers & Pages → Create application, then choose the Worker workflow and connect Git. If you already created a Worker, open it to configure its build settings.
Connect GitHub and select your
cloudflare-link-protectionrepository (or your fork). If it is missing, grant the Cloudflare GitHub app access to that repository. -
Use these build settings
- Worker name
cloudflare-link-protection(matcheswrangler.jsonc)- Production branch
main- Build command
npm run build- Deploy command
npx wrangler deploy- Root directory
/(repository root)
Leave build variables and secrets empty. Keep automatic dependency installation enabled for Wrangler. The committed
wrangler.jsoncselectsdistas the static asset directory. With no private configuration, the build uses the public sample. No runtime variables or bindings are needed. -
Deploy and check the result
Deploy the latest commit. Once the build succeeds, open the HTTPS
workers.devaddress Cloudflare provides and bookmark it. The address is assigned during deployment.- Confirm the neutral profile and three sample buttons appear.
- Check a button opens its
example.complaceholder destination. - Check the layout on your phone and a made-up path returns the 404 page.
Future pushes to
maintrigger new deployments. This checklist does not deploy anything by itself.
If something goes wrong
- Old page: check the latest application changes were pushed to GitHub and the deployment used that commit.
- Configuration error: check the build command is exactly
npm run buildand the demo's build variables and secrets are empty. - Missing output: check the build command and that
wrangler.jsoncwas committed at the repository root. - Repository missing: update the Cloudflare GitHub app's repository access.
- Worker name mismatch: use the same name in Cloudflare and
wrangler.jsonc, or add--name your-worker-nameto the deploy command.
Later: analytics and your own domain
For optional Web Analytics, follow docs/analytics.md. For your own domain, first activate its zone in Cloudflare, then open the Worker's Settings → Domains & Routes → Add → Custom Domain. Wait for DNS and HTTPS activation.
Custom-zone WAF and Managed Challenge rules require a domain you control; they do not cover the Worker's workers.dev address. Test challenges in mobile in-app browsers before making them stricter.
For a separately configured live site, follow docs/cloudflare.md and docs/security.md in the repository.
Official references: Git deployment, build settings, static assets, and custom domains.