From 0860cea0c25f34582d03f17ccde23c5dfec64c12 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Sun, 6 Sep 2026 18:32:21 -0700 Subject: [PATCH] fix(marketing): deploy site with nightly releases (#10443) --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ docs/operations/release.md | 13 ++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8820651184789330531a690f052b883523bc2f17..7f9bd341db83d88d50d3dcad535bb816eae0adf0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1057,6 +1057,60 @@ jobs: "${vercel_scope_args[@]}" fi + deploy_marketing: + name: Deploy marketing site + needs: [preflight, release] + if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'nightly' }} + runs-on: blacksmith-8vcpu-ubuntu-2404 + timeout-minutes: 10 + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + ref: ${{ needs.preflight.outputs.ref }} + sparse-checkout: | + /* + !/.repos/ + sparse-checkout-cone-mode: false + + - name: Setup Vite+ + uses: voidzero-dev/setup-vp@v1 + with: + node-version-file: package.json + cache: true + run-install: | + args: + - --filter=@t3tools/marketing... + + - name: Deploy marketing site to Vercel + shell: bash + run: | + set -euo pipefail + + if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" ]]; then + echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID." >&2 + exit 1 + fi + + VERCEL_PROJECT_ID="$( + curl --fail --silent --show-error \ + --header "Authorization: Bearer $VERCEL_TOKEN" \ + "https://api.vercel.com/v9/projects/t3code-marketing?teamId=$VERCEL_ORG_ID" \ + | jq --exit-status --raw-output '.id' + )" + export VERCEL_PROJECT_ID + + vp dlx vercel@53.1.1 deploy \ + --archive=tgz \ + --prod \ + --yes \ + --token "$VERCEL_TOKEN" \ + --scope "${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}" + finalize: name: Finalize release if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }} diff --git a/docs/operations/release.md b/docs/operations/release.md index 5097457ae0afae7fdfdc44806f1d1144adc934ee..92f7278d779ac3995bd975142764bea60963f754 100644 --- a/docs/operations/release.md +++ b/docs/operations/release.md @@ -111,6 +111,17 @@ Developers deploy personal stages locally rather than through pull-request autom vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local ``` +## Marketing site deployment + +After a nightly release is published, the release workflow deploys the same commit +to the marketing site's Vercel production project. Stable releases do not deploy +the marketing site because they can promote an older nightly commit. + +The job looks up the `t3code-marketing` project using the existing `VERCEL_TOKEN` +and `VERCEL_ORG_ID` secrets. It also respects the optional `VERCEL_TEAM_SLUG` +variable. The Vercel project's root directory must be `apps/marketing`. +Git deployments remain disabled in `apps/marketing/vercel.ts`. + ## Hosted web app release deployment The hosted app is intentionally not deployed by Vercel's Git integration. The @@ -297,7 +308,7 @@ to validate the workflow. The workflow has no non-publishing `workflow_dispatch` mode. Use normal CI or local quality gates to validate checks and builds without shipping. To exercise the complete release graph at lower stable risk, manually dispatch `channel=nightly`; this still publishes a real nightly npm package, GitHub -prerelease, desktop updater release, and hosted nightly alias, but it does not update stable aliases or +prerelease, desktop updater release, hosted nightly alias, and marketing site, but it does not update stable app aliases or commit a version bump to `main`. Only run it when a real nightly release is acceptable. Manual `channel=stable` is also a real stable-channel release. Omitting signing secrets only makes -- 2.54.0