Skip to content

Commit 1fb467d

Browse files
committed
Revert "Deploy the search Worker only after the site it reads from is live"
This reverts commit 249c8ac.
1 parent 249c8ac commit 1fb467d

2 files changed

Lines changed: 11 additions & 38 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,3 @@ jobs:
5454
- name: Deploy to GitHub Pages
5555
id: deployment
5656
uses: actions/deploy-pages@v4
57-
58-
# Search Worker. Runs last because it answers against search-corpus.json,
59-
# which only exists once the Pages deploy above has published it.
60-
deploy-worker:
61-
runs-on: ubuntu-latest
62-
needs: deploy
63-
steps:
64-
- name: Checkout
65-
uses: actions/checkout@v4
66-
- name: Setup Node
67-
uses: actions/setup-node@v4
68-
with:
69-
node-version-file: "workers/docs-search/.node-version"
70-
cache: npm
71-
cache-dependency-path: workers/docs-search/package-lock.json
72-
- name: Install dependencies
73-
run: npm ci
74-
working-directory: workers/docs-search
75-
- name: Deploy Worker
76-
run: npx wrangler@4 deploy --config wrangler.toml
77-
working-directory: workers/docs-search
78-
env:
79-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
80-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

workers/docs-search/README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ This Worker serves `https://docs.openwebui.com/api/search?q=...`.
55
Do not route `/search*` to this Worker. Docusaurus uses `/search-doc-*.json`
66
for the built-in search index.
77

8-
The Worker is deployed by the `deploy-worker` job in
9-
`.github/workflows/gh-pages.yml`, which runs only after the GitHub Pages deploy
10-
has finished. That ordering matters: the Worker answers against
11-
`https://docs.openwebui.com/search-corpus.json`, which the Pages build produces,
12-
so deploying the Worker first would point it at the previous corpus.
8+
Deploy it from the Cloudflare dashboard using Workers Builds:
139

14-
Two repository secrets are required:
10+
1. Create or open the `open-webui-docs-search` Worker.
11+
2. Connect this GitHub repository under **Settings > Builds**.
12+
3. Set the Worker root directory to `workers/docs-search`.
13+
4. Use the production branch `main`.
14+
5. Leave the build command empty, or use `echo ready` if Cloudflare requires one.
15+
6. Use `npx wrangler@4 deploy --config wrangler.toml` as the deploy command.
16+
7. Save and deploy.
1517

16-
- `CLOUDFLARE_API_TOKEN`, scoped to edit Workers on the `openwebui.com` account
17-
- `CLOUDFLARE_ACCOUNT_ID`
18-
19-
**Turn off Cloudflare's own build trigger.** If the Worker is also connected to
20-
this repository under **Settings > Builds** in the Cloudflare dashboard,
21-
Cloudflare starts its own deploy on every push to `main`, independently of
22-
GitHub Actions and with no ordering against the Pages build. Disconnect that
23-
integration, or the two deploy paths race and the ordering above buys nothing.
18+
No GitHub Cloudflare secrets are needed. The Worker fetches the static corpus
19+
from `https://docs.openwebui.com/search-corpus.json`, which is generated by the
20+
normal GitHub Pages docs build.

0 commit comments

Comments
 (0)