@gurupanguji

Scheduled Post Deploy And Social Gating Design

Goal

Make scheduled blog posts reliably go live before social snippets publish, and prevent dead-link social posts when the site is not yet updated.

Problem

The current system treats _posts/ and _snippets/ as parallel tracks:

That leaves a gap for future-dated posts. A post can exist on main and still be excluded from the built site until its publish timestamp passes. Because there is no scheduled rebuild at publish time, the site can stay stale while social still posts the snippet.

Design

1. Add an explicit scheduled site rebuild workflow

Add a workflow that runs daily after the expected publish window for scheduled posts.

This keeps the site deployment model simple and works with the current GitHub Pages style push-based setup.

2. Add a hard preflight gate before social publishing

Extend scripts/publish_social.py so it can verify the post URL before posting.

Checks:

If the page is not live, the script must exit non-zero and publish nothing.

3. Add bounded retries to the preflight gate

The social workflow should tolerate a late deploy without posting too early.

Defaults:

The workflow should wait and recheck until the URL is live or the retry budget is exhausted.

4. Add deploy-window validation

Extend scripts/validate_posts.py so it validates scheduled-post timing against the operational window.

Rules:

This turns the “05:00 PT” publishing expectation into an enforced repository rule instead of tribal knowledge.

5. Normalize future scheduled posts

Update all future posts from 2026-03-23 onward so their front matter date uses 12:00:00 +0000.

This aligns:

File Changes

New

Modify

Operational Notes

Risks

Scheduled rebuild depends on repository write access

If GitHub Actions cannot push a rebuild marker commit to main, the workflow will fail. In that case, the fallback remains the social preflight gate, which stops dead-link posting.

URL checks can fail on transient network errors

Retries reduce false negatives, but the workflow should still fail loudly when the page never becomes live.

Daylight saving time drift

This design targets the current 05:00 PT == 12:00 UTC policy and encodes that explicitly. If the policy changes, the workflow cron and validator constant must change together.

Acceptance Criteria

  1. A post scheduled for 2026-03-23 12:00:00 +0000 is included in a rebuild that runs at 12:10 UTC.
  2. Social publishing refuses to post when the page returns non-200 or the title check fails.
  3. Social publishing waits up to one hour for a delayed deploy, then fails without posting if the page never goes live.
  4. Validation fails when a future scheduled post uses the wrong publish timestamp.
  5. Future posts from March 23 onward are normalized to 12:00:00 +0000.