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.

  1. 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/, and dist-private/ Git-ignored. The committed config/site.example.json provides the neutral demo.

  2. 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-protection repository (or your fork). If it is missing, grant the Cloudflare GitHub app access to that repository.

  3. Use these build settings

    Worker name
    cloudflare-link-protection (matches wrangler.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.jsonc selects dist as the static asset directory. With no private configuration, the build uses the public sample. No runtime variables or bindings are needed.

  4. Deploy and check the result

    Deploy the latest commit. Once the build succeeds, open the HTTPS workers.dev address 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.com placeholder destination.
    • Check the layout on your phone and a made-up path returns the 404 page.

    Future pushes to main trigger 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 build and the demo's build variables and secrets are empty.
  • Missing output: check the build command and that wrangler.jsonc was 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-name to 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.