Skip to content

Commit ffabfc5

Browse files
committed
fix: main should deploy to preview, widgets should by default be off
1 parent c477b24 commit ffabfc5

4 files changed

Lines changed: 17 additions & 16 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ AIRDROP_API_KEY=
115115
NEXT_PUBLIC_AI_CREDITS_BACKEND_URL=
116116
NEXT_PUBLIC_AI_CREDITS_FUNDING_VAULT_ADDRESS=
117117
# Hide the dashboard button while keeping /{locale}/ai-credits accessible.
118-
NEXT_PUBLIC_AI_CREDITS_WIDGET_DASHBOARD_ENABLED=true
118+
NEXT_PUBLIC_AI_CREDITS_WIDGET_DASHBOARD_ENABLED=false

.github/workflows/goodwallet-main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ jobs:
3333
with:
3434
cmd: biome:verify:all
3535

36-
- name: Pull Vercel Production environment
36+
- name: Pull Vercel Preview environment
3737
env:
3838
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
3939
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4040
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
41-
run: npx --yes vercel@latest pull --yes --environment=production --token="$VERCEL_TOKEN"
41+
run: npx --yes vercel@latest pull --yes --environment=preview --token="$VERCEL_TOKEN"
4242

43-
- name: Build Vercel prebuilt Production artifact
43+
- name: Build Vercel prebuilt Preview artifact
4444
env:
4545
NODE_OPTIONS: --max_old_space_size=8192
4646
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
4747
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
4848
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
49-
run: npx --yes vercel@latest build --prod --token="$VERCEL_TOKEN"
49+
run: npx --yes vercel@latest build --target=preview --token="$VERCEL_TOKEN"
5050

5151
- name: Run Tests
5252
uses: borales/actions-yarn@v5
@@ -61,12 +61,12 @@ jobs:
6161
with:
6262
cmd: test:e2e
6363

64-
- name: Deploy Vercel prebuilt Production
64+
- name: Deploy Vercel prebuilt Preview
6565
env:
6666
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
6767
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
6868
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
69-
run: npx --yes vercel@latest deploy --prebuilt --prod --token="$VERCEL_TOKEN"
69+
run: npx --yes vercel@latest deploy --prebuilt --target=preview --token="$VERCEL_TOKEN"
7070

7171
- name: Upload Playwright screenshots and failure artifacts
7272
if: always()

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ Then open http://localhost:3000 in your browser
9898
Vercel Git deployments are disabled in `vercel.json`. Pull requests targeting
9999
`main` are handled by the Preview workflow and deployed as prebuilt Preview
100100
artifacts after the checks pass. Pushes to `main` are handled by the main branch
101-
workflow and deployed as prebuilt Production artifacts. Pushes to `production`
102-
use a separate release workflow with the same prebuilt Production deployment
103-
steps, preserving the existing promotion-by-merge process without relying on
104-
Vercel Git deployments. Domains remain managed by Vercel.
101+
workflow and deployed as prebuilt Preview artifacts. Pushes to `production` use
102+
a separate release workflow with prebuilt Production deployment steps,
103+
preserving the existing promotion-by-merge process without relying on Vercel
104+
Git deployments. Domains remain managed by Vercel.
105105

106106
The repository needs these GitHub Actions secrets:
107107

@@ -112,10 +112,11 @@ The repository needs these GitHub Actions secrets:
112112
## GoodWidget visibility
113113

114114
Widget routes are registered independently from dashboard buttons. For example,
115-
setting `NEXT_PUBLIC_AI_CREDITS_WIDGET_DASHBOARD_ENABLED=false` hides the AI
116-
Credits button while keeping the authenticated `/{locale}/ai-credits` path
117-
available. `NEXT_PUBLIC_*` values are read during the Next.js build, so a Vercel
118-
environment change requires a new deployment/redeploy.
115+
setting `NEXT_PUBLIC_AI_CREDITS_WIDGET_DASHBOARD_ENABLED=true` shows the AI
116+
Credits button; it is hidden when unset or set to `false`, while the authenticated
117+
`/{locale}/ai-credits` path remains available. `NEXT_PUBLIC_*` values are read
118+
during the Next.js build, so a Vercel environment change requires a new
119+
deployment/redeploy.
119120

120121
## GoodWidget local-tarball workflow
121122

src/widgets/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const aiCreditsWidget = defineWidget({
162162
description: "Purchase AI compute credits with your G$ balance",
163163
dashboardVisible: readBooleanEnv(
164164
"NEXT_PUBLIC_AI_CREDITS_WIDGET_DASHBOARD_ENABLED",
165-
true,
165+
false,
166166
),
167167
icon: { kind: "local", render: () => createElement(AiCreditsIcon) },
168168
integrationMode: "web-component",

0 commit comments

Comments
 (0)