Skip to content

Commit a38c3e1

Browse files
authored
hotfix: github actions (#2367)
1 parent 5be11af commit a38c3e1

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

.github/workflows/deploy-docs-bundle-preview.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: ./.github/actions/turbo-ignore
3434
with:
3535
token: ${{ secrets.VERCEL_TOKEN }}
36-
project: "app.buildwithfern.com"
36+
project: "legacy.buildwithfern.com"
3737
package: "@fern-docs/bundle"
3838
environment: "preview"
3939
branch: ${{ github.event.pull_request.head.ref || github.ref_name || github.ref }}
@@ -43,7 +43,7 @@ jobs:
4343
if: needs.ignore.outputs.continue == 1 || needs.ignore.outputs.check_changes == 1
4444
runs-on: ubuntu-latest
4545
environment:
46-
name: Preview - app.buildwithfern.com
46+
name: Preview - legacy.buildwithfern.com
4747
url: ${{ steps.deploy.outputs.deployment_url }}
4848
outputs:
4949
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
@@ -60,7 +60,7 @@ jobs:
6060
- name: Build & Deploy to Vercel
6161
id: deploy
6262
run: |
63-
pnpm vercel-scripts deploy app.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }}
63+
pnpm vercel-scripts deploy legacy.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }}
6464
if [ -f deployment-url.txt ]; then
6565
pnpm vercel-scripts preview.txt $(cat deployment-url.txt) --token=${{ secrets.VERCEL_TOKEN }}
6666
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT
@@ -89,7 +89,7 @@ jobs:
8989

9090
- name: Build
9191
id: deploy
92-
run: pnpm vercel-scripts deploy app.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }} --skip-deploy=true
92+
run: pnpm vercel-scripts deploy legacy.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }} --skip-deploy=true
9393
env:
9494
ANALYZE: 1
9595

.github/workflows/deploy-docs-bundle-prod.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ on:
77
- ui@*
88

99
concurrency:
10-
group: app.buildwithfern.com
10+
group: legacy.buildwithfern.com
1111
cancel-in-progress: true
1212

1313
jobs:
1414
deploy_app_buildwithfern_com:
1515
runs-on: ubuntu-latest
1616
if: github.ref_type == 'tag' && github.event_name == 'push'
1717
environment:
18-
name: Production - app.buildwithfern.com
18+
name: Production - legacy.buildwithfern.com
1919
url: ${{ steps.deploy.outputs.deployment_url }}
2020
outputs:
2121
deployment_url: ${{ steps.deploy.outputs.deployment_url }}
@@ -26,7 +26,7 @@ jobs:
2626
- name: Build & Deploy to Vercel
2727
id: deploy
2828
run: |
29-
pnpm vercel-scripts deploy app.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }} --environment=production
29+
pnpm vercel-scripts deploy legacy.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }} --environment=production
3030
echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT
3131
3232
deploy_app_ferndocs_com:
@@ -72,7 +72,7 @@ jobs:
7272
# TODO: Fix the tests and run them before promoting the deployment
7373
ete:
7474
needs:
75-
- deploy_app_buildwithfern_com # only the app.buildwithfern.com deployment is an E2E candidate but ideally all deployments should be tested
75+
- deploy_app_buildwithfern_com # only the legacy.buildwithfern.com deployment is an E2E candidate but ideally all deployments should be tested
7676
- promote
7777
if: needs.deploy_app_buildwithfern_com.outputs.deployment_url
7878
uses: ./.github/workflows/playwright.yml
@@ -91,8 +91,8 @@ jobs:
9191
steps:
9292
- uses: actions/checkout@v4
9393
- uses: ./.github/actions/install
94-
- name: Revalidate all app.buildwithfern.com deployments
95-
run: pnpm vercel-scripts revalidate-all app.buildwithfern.com --token ${{ secrets.VERCEL_TOKEN }}
94+
- name: Revalidate all legacy.buildwithfern.com deployments
95+
run: pnpm vercel-scripts revalidate-all legacy.buildwithfern.com --token ${{ secrets.VERCEL_TOKEN }}
9696

9797
rollback:
9898
needs: ete
@@ -106,13 +106,13 @@ jobs:
106106
- name: Rollback on failure # remove this step once we switch back to pre-promotion testing
107107
run: |
108108
echo "E2E tests failed. Rolling back deployment"
109-
pnpm vercel-scripts rollback app.buildwithfern.com --token ${{ secrets.VERCEL_TOKEN }}
109+
pnpm vercel-scripts rollback legacy.buildwithfern.com --token ${{ secrets.VERCEL_TOKEN }}
110110
pnpm vercel-scripts rollback app.ferndocs.com --token ${{ secrets.VERCEL_TOKEN }}
111111
pnpm vercel-scripts rollback app-slash.ferndocs.com --token ${{ secrets.VERCEL_TOKEN }}
112112
113-
# currently only the custom domains for app.buildwithfern.com deployment should be revalidated
113+
# currently only the custom domains for legacy.buildwithfern.com deployment should be revalidated
114114
# because the other deployments don't have custom domains (yet)
115-
pnpm vercel-scripts revalidate-all app.buildwithfern.com --token ${{ secrets.VERCEL_TOKEN }}
115+
pnpm vercel-scripts revalidate-all legacy.buildwithfern.com --token ${{ secrets.VERCEL_TOKEN }}
116116
echo "All docs deployments have been rolled back successfully!"
117117
exit 1
118118

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: pnpm i -g fern-api@latest
3636

3737
- name: Fetch domains
38-
run: pnpm vercel-scripts domains.txt app.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }}
38+
run: pnpm vercel-scripts domains.txt legacy.buildwithfern.com --token=${{ secrets.VERCEL_TOKEN }}
3939

4040
- name: Install Playwright Browsers
4141
run: pnpm exec playwright install chromium

.github/workflows/revalidate-all.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
type: string
88
description: "The deployment URL to revalidate"
99
required: true
10-
default: "app.buildwithfern.com"
10+
default: "legacy.buildwithfern.com"
1111
workflow_dispatch:
1212
inputs:
1313
deployment_url:
1414
type: string
1515
description: "The deployment URL to revalidate"
1616
required: false
17-
default: "app.buildwithfern.com"
17+
default: "legacy.buildwithfern.com"
1818

1919
env:
2020
VERCEL_ORG_ID: team_6FKOM5nw037hv8g2mTk3gaH7
@@ -30,4 +30,4 @@ jobs:
3030
uses: ./.github/actions/install
3131

3232
- name: Revalidate all
33-
run: pnpm vercel-scripts revalidate-all ${{ inputs.deployment_url || 'app.buildwithfern.com' }} --token ${{ secrets.VERCEL_TOKEN }}
33+
run: pnpm vercel-scripts revalidate-all ${{ inputs.deployment_url || 'legacy.buildwithfern.com' }} --token ${{ secrets.VERCEL_TOKEN }}

packages/fern-docs/bundle/src/app/api/fern-docs/search/v2/chat/route.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ export async function POST(req: NextRequest) {
4646
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
4747
});
4848

49-
const languageModel = wrapAISDKModel(
50-
bedrock("us.anthropic.claude-3-5-sonnet-20241022-v2:0")
51-
);
52-
53-
const openai = createOpenAI({ apiKey: openaiApiKey() });
54-
const embeddingModel = openai.embedding("text-embedding-3-large");
55-
56-
const domain = getDocsDomainEdge(req);
57-
const namespace = `${withoutStaging(domain)}_${embeddingModel.modelId}`;
58-
5949
const { messages, url } = await req.json();
6050

6151
// TODO: SORRY DEEP - NEED TO PUSH FOR WEBFLOW
@@ -71,8 +61,18 @@ export async function POST(req: NextRequest) {
7161
webflowVersion = "Browser API";
7262
}
7363
}
64+
65+
const languageModel = isWebflow
66+
? wrapAISDKModel(bedrock("us.anthropic.claude-3-7-sonnet-20240620-v1:0"))
67+
: wrapAISDKModel(bedrock("us.anthropic.claude-3-5-sonnet-20241022-v2:0"));
7468
// END WEBFLOW SPECIFIC CODE
7569

70+
const openai = createOpenAI({ apiKey: openaiApiKey() });
71+
const embeddingModel = openai.embedding("text-embedding-3-large");
72+
73+
const domain = getDocsDomainEdge(req);
74+
const namespace = `${withoutStaging(domain)}_${embeddingModel.modelId}`;
75+
7676
const orgMetadata = await getOrgMetadataForDomain(withoutStaging(domain));
7777
if (orgMetadata == null) {
7878
return NextResponse.json("Not found", { status: 404 });

0 commit comments

Comments
 (0)