This site is static files in S3 behind CloudFront. There's no server that can wake up in the morning and make an article visible, yet articles here go live on a chosen day, pushed days before. It takes two pieces: a publish date the build checks, and a GitHub Actions run every morning that deploys only if something is due.

The catch: it publishes on a day, not at a time. GitHub started its scheduled runs about five to ten hours late, so an article goes live some time that afternoon or evening.

A date the build checks

Scheduling an article means replacing status: draft in its front matter with a date:

publish: 2026-11-09

The Vite plugin that reads the articles at build time compares that date with today's date in Toronto, and leaves anything later out of a production build:

const today = () => new Date().toLocaleDateString("en-CA", { timeZone: "America/Toronto" });

scheduled: publish && publish > today() ? publish : null,

.filter((article) => dev || (!article.draft && !article.scheduled))

Left out, not hidden. A scheduled article isn't in the bundle, the pre-rendered HTML or the sitemap, so nobody can read it early and search engines don't see the URL.

The time zone is fixed. GitHub's runners use UTC, so without timeZone an article dated November 9 would count as due from 7:00 PM on November 8 in Toronto. The en-CA locale formats dates as YYYY-MM-DD, which makes the check a plain string comparison. The plugin also rejects any publish value not in that format, because "2026-11-9" sorts after "2026-11-10" and would quietly never go live.

A daily run that deploys only when needed

The deploy workflow gets a schedule next to its push trigger:

schedule:
  - cron: "17 13 * * *"   # about 9:15 AM in Toronto (8:15 AM in winter)

Redeploying every morning would work, but each deploy clears CloudFront's cache and tells search engines every page changed. So the scheduled run builds the site, then compares its list of pages with the live sitemap's, and skips the deploy if they match:

- name: Compare pages with the live site
  id: compare
  if: github.event_name == 'schedule'
  run: |
    pages() { grep -o '<loc>[^<]*' | sort; }
    if [ "$(pages < build/sitemap.xml)" = "$(curl -fsS https://rrjamal.ca/sitemap.xml | pages)" ]; then
      echo "changed=false" >> "$GITHUB_OUTPUT"
    fi
flowchart LR
  cron[Daily run] --> build[Build with<br/>today's date]
  build --> cmp{Same pages as<br/>live sitemap?}
  cmp -->|yes| stop[Stop]
  cmp -->|no| deploy[Deploy]

Why compare with the live site instead of checking "is any article due today?": GitHub sometimes drops scheduled runs. If that day's run never happens, a date check the next day finds nothing due and the article never goes live. A comparison with the live site catches up on the next run, whenever that is. And if the live sitemap can't be fetched, the lists differ and it deploys anyway, which is the safe way to be wrong.

Two weeks of real runs

Three articles were scheduled in the first two weeks of November 2026. The daily run deployed on exactly those three days and on none of the other eleven. Every run started late, between 4 hours 47 minutes and 9 hours 44 minutes after the 13:17 UTC it asked for, but all on the right day in Toronto. No run was dropped, so the catch-up hasn't been tested by a real one yet.

What it doesn't do

  • No time of day. For "live at 9:00 AM", you need an external scheduler or a real server.
  • The article has to be pushed first. The run builds what's on GitHub, not your laptop.
  • A run that slips past midnight goes live a day late, still showing the earlier date. It hasn't happened yet; the latest run started at 6:01 PM Toronto time.
  • Public repositories need activity. GitHub turns off scheduled workflows in a public repository after 60 days without commits. This one is private, so the rule doesn't apply.