open-design/.github/workflows
lefarcen 7312c64580
ci(landing): split landing deploy into staging gate + manual production (#2994)
* ci(landing): split landing deploy into staging gate + manual production

A merge to `main` previously published the landing page straight to
production (open-design.ai) via `landing-page-deploy`. There was no
buffer to review the rendered site, so a bad merge was live instantly.

Split deploys across two Cloudflare Pages projects so production is only
ever reached by an explicit human action:

- `landing-page-staging` (push to main) -> staging project
  `open-design-landing-staging` -> staging.open-design.ai.
- `landing-page-production` (manual workflow_dispatch only) -> production
  project `open-design-landing` -> open-design.ai. Only this workflow
  names the production project; gate it with required reviewers on the
  `production` GitHub environment.
- `landing-page-ci` now also deploys a per-PR preview into the staging
  project (`--branch=pr-<n>`) for same-repo branches and comments the URL.
  Fork PRs (no secrets / read-only token) skip the deploy and keep just
  the build validation. Path filters already scope this to landing edits.

Decouple search-engine indexing from staging:

- `blog-indexing-on-deploy` now triggers on `landing-page-production`
  (not every main push), so the test environment is never submitted to
  Google/IndexNow.
- It diffs from a new `blog-indexed-prod` tag (the last indexed prod
  commit) instead of `HEAD^`, and force-advances the tag after a
  successful run, so a manual promotion bundling several merged posts
  indexes all of them rather than only the last commit.

Staging and PR-preview builds drop `PUBLIC_GA_MEASUREMENT_ID` so test
traffic does not pollute the production GA property.

* ci(landing): keep staging + PR previews out of the search index

staging.open-design.ai mirrors production and is exposed via cert
transparency logs, so search engines can discover it. Indexing the
mirror competes with open-design.ai for the same content.

Emit `<meta name="robots" content="noindex, nofollow">` whenever
OD_LANDING_NOINDEX=1, and set that flag on the staging and PR-preview
builds (production leaves it unset and stays indexable). noindex is
used rather than a robots.txt Disallow so crawlers can still fetch the
page and read both the tag and the canonical, which already points at
the production origin.

* fix(landing): make staging noindex actually take effect

The previous commit read `process.env.OD_LANDING_NOINDEX` directly in
`seo-head.astro`, but `.astro` frontmatter is transformed by Vite and
does not see process.env, so the meta never rendered. Two fixes:

- Inject the flag as the compile-time constant `__OD_LANDING_NOINDEX__`
  via `vite.define` in astro.config.ts (config runs in Node and can read
  process.env); SeoHead consumes that constant.
- The homepage (`index.astro`) and `og.astro` build their own <head> and
  never use SeoHead, so a per-component meta can miss pages. Add an
  `astro:build:done` integration that appends a catch-all
  `/*  X-Robots-Tag: noindex, nofollow` to the Cloudflare Pages `_headers`
  on staging/preview builds, covering every response (homepage, assets,
  any custom-head page) at the HTTP layer. Production builds leave
  `_headers` untouched.

Verified: build with OD_LANDING_NOINDEX=1 emits the _headers block and
the SeoHead <meta>; build without the flag emits neither; astro check
clean.

* fix(landing): address review — pin prod checkout to main, defer index pointer

Two blockers from review:

- landing-page-production: workflow_dispatch can be launched from any ref
  via the Actions "Use workflow from" dropdown, so an operator could ship
  an arbitrary branch to open-design.ai. Pin the checkout to `ref: main`
  so the deployed artifact always equals reviewed main.

- blog-indexing-on-deploy: the `blog-indexed-prod` pointer was advanced
  right after sitemap submission, before Inspect / Search Analytics /
  Render status / Open status PR. A failure in any of those still moved
  the pointer, so the next production run skipped those posts. Move the
  advance to the very end, gated on `success()`, so a failure leaves the
  tag in place and the range is re-processed next run (submissions are
  idempotent).

* fix(landing): gate production promotion to the main ref only

Follow-up to the production-path review note: pinning checkout to main
fixed the deployed content, but the workflow was still dispatchable from
any ref, which records a non-main production run and would dodge
blog-indexing's `workflow_run` `branches: [main]` filter. Gate the whole
job on `github.ref == 'refs/heads/main'` so a dispatch from any other
branch/tag is skipped outright.
2026-05-26 14:05:04 +00:00
..
actionlint.yml fix(ci): lint workflow changes with actionlint (#2742) 2026-05-23 12:12:55 +08:00
agent-pr-explore-sandbox.yml ci: make agent PR exploration manual only (#2993) 2026-05-26 12:59:58 +00:00
agent-pr-explore.lock.yml ci: add agent explore workflow placeholder (#2830) 2026-05-24 20:22:51 +08:00
blog-3day-report.yml fix(ci): lint workflow changes with actionlint (#2742) 2026-05-23 12:12:55 +08:00
blog-indexing-monitor.yml fix(ci): lint workflow changes with actionlint (#2742) 2026-05-23 12:12:55 +08:00
blog-indexing-on-deploy.yml ci(landing): split landing deploy into staging gate + manual production (#2994) 2026-05-26 14:05:04 +00:00
ci.yml ci(landing): split landing deploy into staging gate + manual production (#2994) 2026-05-26 14:05:04 +00:00
contributor-card-bot.yml fix(contributor-bot): serialize runs to avoid state.json races and duplicate cards (#1707) 2026-05-14 20:01:13 +08:00
critique-conformance.yml feat(daemon): Critique Theater Phase 16 (M-phase rollout ratchet + /api/critique/conformance) (#1499) 2026-05-14 11:05:57 +08:00
discord-resolved.yml ci: skip upstream-only workflows on forks (#1586) 2026-05-14 14:27:23 +08:00
docker-image.yml fix(ci): only run docker image workflow for release tags (#1916) 2026-05-16 22:32:33 +08:00
fork-pr-workflow-approval.yml fix(ci): run fork visual reports from trusted code (#2935) 2026-05-26 06:17:04 +00:00
landing-page-ci.yml ci(landing): split landing deploy into staging gate + manual production (#2994) 2026-05-26 14:05:04 +00:00
landing-page-production.yml ci(landing): split landing deploy into staging gate + manual production (#2994) 2026-05-26 14:05:04 +00:00
landing-page-staging.yml ci(landing): split landing deploy into staging gate + manual production (#2994) 2026-05-26 14:05:04 +00:00
metrics.yml fix(ci): use open-design-bot for metrics PRs (#1910) 2026-05-16 21:52:37 +08:00
nix-check.yml chore: optimize CI and beta release runtime (#2231) 2026-05-19 18:06:28 +08:00
nix-hash-autofix.yml chore(nix): streamline pnpm deps hash maintenance (#2919) 2026-05-26 07:35:38 +00:00
pr-author-inactivity.yml fix(ci): anchor PR inactivity clock to author responses (#2185) 2026-05-19 13:59:15 +08:00
refresh-contributors-wall.yml ci: skip upstream-only workflows on forks (#1586) 2026-05-14 14:27:23 +08:00
release-beta.yml feat(pack): add Windows portable zip target alongside NSIS installer (#2937) 2026-05-26 06:14:44 +00:00
release-preview.yml feat(pack): add Windows portable zip target alongside NSIS installer (#2937) 2026-05-26 06:14:44 +00:00
release-stable.yml feat(pack): add Windows portable zip target alongside NSIS installer (#2937) 2026-05-26 06:14:44 +00:00
seo-daily-report.yml fix(ci): lint workflow changes with actionlint (#2742) 2026-05-23 12:12:55 +08:00
stale-issues.yml ci: add PR-author and stale-issue inactivity workflows (#2055) 2026-05-18 16:45:37 +08:00
visual-baseline.yml chore(ci): add visual regression PR workflow (#2372) 2026-05-20 15:05:59 +08:00
visual-pr-capture.yml ci: gate fork PR workflow auto-approval (#2683) 2026-05-23 11:48:36 +08:00
visual-pr-comment.yml fix(ci): run fork visual reports from trusted code (#2935) 2026-05-26 06:17:04 +00:00
visual-pr-verify.yml fix(ci): align visual selectors and nix hashes (#2471) 2026-05-21 10:45:37 +08:00