Skip to content

Commit 0860cea

Browse files
authored
fix(marketing): deploy site with nightly releases (pingdotgg#10443)
1 parent 95f9b14 commit 0860cea

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,60 @@ jobs:
10571057
"${vercel_scope_args[@]}"
10581058
fi
10591059
1060+
deploy_marketing:
1061+
name: Deploy marketing site
1062+
needs: [preflight, release]
1063+
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'nightly' }}
1064+
runs-on: blacksmith-8vcpu-ubuntu-2404
1065+
timeout-minutes: 10
1066+
env:
1067+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
1068+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1069+
VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
1070+
steps:
1071+
- name: Checkout
1072+
uses: actions/checkout@v6
1073+
with:
1074+
ref: ${{ needs.preflight.outputs.ref }}
1075+
sparse-checkout: |
1076+
/*
1077+
!/.repos/
1078+
sparse-checkout-cone-mode: false
1079+
1080+
- name: Setup Vite+
1081+
uses: voidzero-dev/setup-vp@v1
1082+
with:
1083+
node-version-file: package.json
1084+
cache: true
1085+
run-install: |
1086+
args:
1087+
- --filter=@t3tools/marketing...
1088+
1089+
- name: Deploy marketing site to Vercel
1090+
shell: bash
1091+
run: |
1092+
set -euo pipefail
1093+
1094+
if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" ]]; then
1095+
echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID." >&2
1096+
exit 1
1097+
fi
1098+
1099+
VERCEL_PROJECT_ID="$(
1100+
curl --fail --silent --show-error \
1101+
--header "Authorization: Bearer $VERCEL_TOKEN" \
1102+
"https://api.vercel.com/v9/projects/t3code-marketing?teamId=$VERCEL_ORG_ID" \
1103+
| jq --exit-status --raw-output '.id'
1104+
)"
1105+
export VERCEL_PROJECT_ID
1106+
1107+
vp dlx [email protected] deploy \
1108+
--archive=tgz \
1109+
--prod \
1110+
--yes \
1111+
--token "$VERCEL_TOKEN" \
1112+
--scope "${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
1113+
10601114
finalize:
10611115
name: Finalize release
10621116
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }}

‎docs/operations/release.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ Developers deploy personal stages locally rather than through pull-request autom
111111
vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local
112112
```
113113

114+
## Marketing site deployment
115+
116+
After a nightly release is published, the release workflow deploys the same commit
117+
to the marketing site's Vercel production project. Stable releases do not deploy
118+
the marketing site because they can promote an older nightly commit.
119+
120+
The job looks up the `t3code-marketing` project using the existing `VERCEL_TOKEN`
121+
and `VERCEL_ORG_ID` secrets. It also respects the optional `VERCEL_TEAM_SLUG`
122+
variable. The Vercel project's root directory must be `apps/marketing`.
123+
Git deployments remain disabled in `apps/marketing/vercel.ts`.
124+
114125
## Hosted web app release deployment
115126

116127
The hosted app is intentionally not deployed by Vercel's Git integration. The
@@ -297,7 +308,7 @@ to validate the workflow.
297308
The workflow has no non-publishing `workflow_dispatch` mode. Use normal CI or local quality gates to
298309
validate checks and builds without shipping. To exercise the complete release graph at lower stable
299310
risk, manually dispatch `channel=nightly`; this still publishes a real nightly npm package, GitHub
300-
prerelease, desktop updater release, and hosted nightly alias, but it does not update stable aliases or
311+
prerelease, desktop updater release, hosted nightly alias, and marketing site, but it does not update stable app aliases or
301312
commit a version bump to `main`. Only run it when a real nightly release is acceptable.
302313

303314
Manual `channel=stable` is also a real stable-channel release. Omitting signing secrets only makes

0 commit comments

Comments
 (0)