Skip to content

Commit feb6735

Browse files
authored
Abstract data fetching between v1 and v2 (#2865)
1 parent f1d1d2f commit feb6735

File tree

134 files changed

+3551
-2173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+3551
-2173
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
echo "SENTRY_ENVIRONMENT=preview" >> $GITHUB_ENV
4040
if: 1 && !startsWith(github.ref, 'refs/heads/main')
4141
- name: Build Next.js with next-on-pages
42-
run: bun run turbo build:cloudflare
42+
run: bun run turbo gitbook#build:cloudflare
4343
env:
4444
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
4545
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY: ${{ secrets.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY }}
@@ -49,7 +49,7 @@ jobs:
4949
SENTRY_RELEASE: ${{ github.sha }}
5050
- id: deploy
5151
name: Deploy to Cloudflare
52-
uses: cloudflare/wrangler-action@v3.11.0
52+
uses: cloudflare/wrangler-action@v3.14.0
5353
with:
5454
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
5555
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
@@ -103,7 +103,8 @@ jobs:
103103
run: |
104104
echo "VERCEL_ENVIRONMENT=production" >> $GITHUB_ENV
105105
echo "SENTRY_ENVIRONMENT=production" >> $GITHUB_ENV
106-
echo "GITBOOK_ASSETS_PREFIX=https://static.gitbook.com" >> $GITHUB_ENV
106+
echo "GITBOOK_URL=https://open-2v.gitbook.com" >> $GITHUB_ENV
107+
echo "GITBOOK_ASSETS_PREFIX=https://static-2v.gitbook.com" >> $GITHUB_ENV
107108
if: startsWith(github.ref, 'refs/heads/main')
108109
- name: Sets env vars for preview
109110
run: |
@@ -124,7 +125,7 @@ jobs:
124125
- name: Deploy Project Artifacts to Vercel
125126
id: deploy
126127
run: |
127-
DEPLOYMENT_URL=$(bun run vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
128+
DEPLOYMENT_URL=$(bun run vercel deploy --prebuilt --target=$VERCEL_ENVIRONMENT $([ "$VERCEL_ENVIRONMENT" = "production" ] && echo "--prod") --token=${{ secrets.VERCEL_TOKEN }})
128129
echo "deployment-url=$DEPLOYMENT_URL" >> "$GITHUB_OUTPUT"
129130
- name: Outputs
130131
run: |
@@ -156,7 +157,8 @@ jobs:
156157
- name: Sets env vars for production
157158
run: |
158159
echo "SENTRY_ENVIRONMENT=production" >> $GITHUB_ENV
159-
echo "GITBOOK_ASSETS_PREFIX=https://static.gitbook.com" >> $GITHUB_ENV
160+
echo "GITBOOK_URL=https://open-2c.gitbook.com" >> $GITHUB_ENV
161+
echo "GITBOOK_ASSETS_PREFIX=https://static-2c.gitbook.com" >> $GITHUB_ENV
160162
if: startsWith(github.ref, 'refs/heads/main')
161163
- name: Sets env vars for preview
162164
run: |
@@ -173,7 +175,7 @@ jobs:
173175
SENTRY_RELEASE: ${{ github.sha }}
174176
- id: deploy
175177
name: Deploy to Cloudflare
176-
uses: cloudflare/wrangler-action@v3.11.0
178+
uses: cloudflare/wrangler-action@v3.14.0
177179
with:
178180
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
179181
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
@@ -226,8 +228,8 @@ jobs:
226228
227229
| Site | v1 | v2 |
228230
| --- | --- | --- |
229-
| GitBook | [${{ needs.deploy.outputs.deployment-url }}/docs.gitbook.com](${{ needs.deploy.outputs.deployment-url }}/docs.gitbook.com) | [${{ needs.deploy-v2-vercel.outputs.deployment-url }}/static/url/docs.gitbook.com](${{ needs.deploy-v2-vercel.outputs.deployment-url }}/static/url/docs.gitbook.com) |
230-
| E2E | [${{ needs.deploy.outputs.deployment-url }}/gitbook.gitbook.io/test-gitbook-open](${{ needs.deploy.outputs.deployment-url }}/gitbook.gitbook.io/test-gitbook-open) | [${{ needs.deploy-v2-vercel.outputs.deployment-url }}/static/url/gitbook.gitbook.io/test-gitbook-open](${{ needs.deploy-v2-vercel.outputs.deployment-url }}/static/url/gitbook.gitbook.io/test-gitbook-open) |
231+
| GitBook | [${{ needs.deploy.outputs.deployment-url }}/docs.gitbook.com](${{ needs.deploy.outputs.deployment-url }}/docs.gitbook.com) | [${{ needs.deploy-v2-vercel.outputs.deployment-url }}/url/docs.gitbook.com](${{ needs.deploy-v2-vercel.outputs.deployment-url }}/url/docs.gitbook.com) |
232+
| E2E | [${{ needs.deploy.outputs.deployment-url }}/gitbook.gitbook.io/test-gitbook-open](${{ needs.deploy.outputs.deployment-url }}/gitbook.gitbook.io/test-gitbook-open) | [${{ needs.deploy-v2-vercel.outputs.deployment-url }}/url/gitbook.gitbook.io/test-gitbook-open](${{ needs.deploy-v2-vercel.outputs.deployment-url }}/url/gitbook.gitbook.io/test-gitbook-open) |
231233
edit-mode: replace
232234
visual-testing:
233235
runs-on: ubuntu-latest

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ packages/icons/src/data/*.json
1111
dist/
1212

1313
README.md
14-
CHANGELOG.md
14+
CHANGELOG.md
15+
16+
# v2
17+
packages/gitbook-v2/public/~gitbook/static/

0 commit comments

Comments
 (0)