Skip to content

CI/CD Setup

The deploy workflow builds the site and uploads it directly to Cloudflare Pages using Wrangler.

How It Works

  1. You push to main in your forked homebase repo
  2. GitHub Actions runs .github/workflows/deploy.yml
  3. It installs deps, builds the site with 11ty, and uploads _site/ to Cloudflare Pages as a production deployment
  4. Every pull request also gets its own live preview deployment, separate from the production URL

Setup Steps

1. Create a Cloudflare Pages project

This must exist once before the first upload. Either use the dashboard (Workers & Pages → Create → Pages → Connect to Git, then disconnect Git afterward since deploys come from this workflow instead) or run this once from your machine:

npx wrangler pages project create your-project-name --production-branch main

Then set name in wrangler.toml to match the project name you chose.

2. Create an API Token

  1. Cloudflare dashboard → My Profile → API Tokens → Create Token → Custom token
  2. Grant Account → Cloudflare Pages → Edit
  3. Copy the token

3. Find your Account ID

Cloudflare dashboard → Workers & Pages — your account ID is shown in the right-hand sidebar.

4. Add Repository Secrets

In your homebase fork, go to Settings → Secrets and variables → Actions, and add:

Secret Value
CLOUDFLARE_API_TOKEN The token from step 2
CLOUDFLARE_ACCOUNT_ID The account ID from step 3

5. Custom Domain (Optional)

Set seo.cname in _data/site.yaml — this only generates a reference CNAME file; the actual domain is attached in Cloudflare, not GitHub:

seo:
  cname: "links.yourdomain.com"

Then, in the Cloudflare dashboard: your Pages project → Custom domains → Set up a custom domain. If the domain's DNS already lives on Cloudflare, the record and free TLS certificate are provisioned automatically. Leave seo.cname blank to use the default your-project-name.pages.dev URL.

6. Analytics (Optional)

To enable Google Analytics 4:

  1. In your homebase fork, go to Settings → Secrets and variables → Actions
  2. Add a secret named GOOGLE_ANALYTICS_ID with your G-XXXXXXXXXX measurement ID

Note

Leave the secret unset to disable analytics entirely. The ID is never stored in the repo.

Triggering Manually

You can trigger a deploy without pushing by going to Actions → Build and Deploy → Run workflow.

Scheduled Rebuilds

scheduled-rebuild.yml automatically rebuilds the site daily at 8am UTC. This keeps time-sensitive content fresh -- notably the YouTube channel feed, which fetches the latest video at build time.

To change the frequency, edit the cron expression in .github/workflows/scheduled-rebuild.yml:

Cron expression Frequency
0 */6 * * * Every 6 hours
0 8 * * * Once daily at 8am UTC
0 8 * * 1 Once weekly, Monday 8am UTC

To disable scheduled rebuilds, delete .github/workflows/scheduled-rebuild.yml.

Warning

GitHub automatically disables scheduled workflows in repos with no activity (pushes, PRs, etc.) for 60 days. If this happens, re-enable it via the Actions tab.

Limits (Cloudflare free plan)

  • Unlimited requests and bandwidth
  • Direct-upload deployments (what this workflow does) do not count toward Cloudflare's monthly build quota
  • 100 custom domains per project; up to 20,000 files per deployment; 25 MiB per file