Skip to content

Commit 8bad120

Browse files
authored
chore(workflow): sync all-stable workflows with patched scraper image (#676)
1 parent 4695836 commit 8bad120

File tree

3 files changed

+73
-4
lines changed

3 files changed

+73
-4
lines changed

.github/workflows/docsearch-all-stable-full-preview.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ on:
1717
- both
1818
- en
1919
- zh
20+
preview_runlist:
21+
description: 'Preview runlist file under all-stable/configs'
22+
required: true
23+
default: runlist-preview-full.json
24+
type: string
25+
scraper_repo:
26+
description: 'Docsearch-scraper repo used to patch workflow image'
27+
required: true
28+
default: 'https://github.com/shczhen/docsearch-scraper.git'
29+
type: string
30+
scraper_ref:
31+
description: 'Docsearch-scraper branch/ref used to patch workflow image'
32+
required: true
33+
default: 'incrementalCrawl'
34+
type: string
2035

2136
permissions:
2237
contents: read
@@ -49,14 +64,15 @@ jobs:
4964
echo "APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}" >> .env
5065
echo "API_KEY=${{ secrets.ALGOLIA_API_KEY }}" >> .env
5166
echo "GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}" >> .env
52-
export DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}"
5367
export GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}
5468
5569
export CRAWL_LANG="${{ inputs.language }}"
5670
PREVIEW_BASE_URL="${{ inputs.preview_base_url }}"
5771
export CRAWL_LOCAL_URL="${PREVIEW_BASE_URL%/}/"
72+
export PREVIEW_RUNLIST_FILE="${{ inputs.preview_runlist }}"
5873
5974
echo "Run preview full prewarm against: $CRAWL_LOCAL_URL"
75+
echo "Use preview runlist file: $PREVIEW_RUNLIST_FILE"
6076
6177
preview_home_status="$(curl -sS -o /dev/null -w "%{http_code}" "$CRAWL_LOCAL_URL")"
6278
if [ "$preview_home_status" != "200" ]; then
@@ -69,6 +85,18 @@ jobs:
6985
exit 1
7086
fi
7187
88+
export BASE_DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}"
89+
export PATCH_SCRAPER_REPO="${{ inputs.scraper_repo }}"
90+
export PATCH_SCRAPER_REF="${{ inputs.scraper_ref }}"
91+
export PATCHED_DOCKER_REGISTRY="local"
92+
export PATCH_IMAGE_ENV_FILE="/tmp/docsearch-patched-image.env"
93+
94+
./all-stable/scripts/prepare-patched-scraper-image.sh "$(pwd)/all-stable"
95+
. "$PATCH_IMAGE_ENV_FILE"
96+
export DOCKER_REGISTRY="$PATCHED_DOCKER_REGISTRY"
97+
export ENABLE_CONTAINER_SOURCE_PROBE=true
98+
99+
echo "Run preview full prewarm with patched image: $PATCHED_SCRAPER_IMAGE"
72100
./all-stable/scripts/crawl-preview-full.sh "$(pwd)/all-stable" 2>&1 | tee /tmp/docsearch-all-stable-full-preview.log
73101
74102
./all-stable/scripts/check-crawl-errors.sh /tmp/docsearch-all-stable-full-preview.log

.github/workflows/docsearch-all-stable-full.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ on:
1212
- both
1313
- en
1414
- zh
15+
scraper_repo:
16+
description: 'Docsearch-scraper repo used to patch workflow image'
17+
required: true
18+
default: 'https://github.com/shczhen/docsearch-scraper.git'
19+
type: string
20+
scraper_ref:
21+
description: 'Docsearch-scraper branch/ref used to patch workflow image'
22+
required: true
23+
default: 'incrementalCrawl'
24+
type: string
1525

1626
permissions:
1727
contents: write
@@ -44,12 +54,21 @@ jobs:
4454
echo "APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}" >> .env
4555
echo "API_KEY=${{ secrets.ALGOLIA_API_KEY }}" >> .env
4656
echo "GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}" >> .env
47-
export DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}"
4857
export GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}
4958
5059
export CRAWL_LANG="${{ inputs.language }}"
5160
52-
echo "Run full crawl against production domain"
61+
export BASE_DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}"
62+
export PATCH_SCRAPER_REPO="${{ inputs.scraper_repo }}"
63+
export PATCH_SCRAPER_REF="${{ inputs.scraper_ref }}"
64+
export PATCHED_DOCKER_REGISTRY="local"
65+
export PATCH_IMAGE_ENV_FILE="/tmp/docsearch-patched-image.env"
66+
67+
./all-stable/scripts/prepare-patched-scraper-image.sh "$(pwd)/all-stable"
68+
. "$PATCH_IMAGE_ENV_FILE"
69+
export DOCKER_REGISTRY="$PATCHED_DOCKER_REGISTRY"
70+
71+
echo "Run full crawl against production domain with patched image: $PATCHED_SCRAPER_IMAGE"
5372
./all-stable/scripts/crawl-full.sh "$(pwd)/all-stable" 2>&1 | tee /tmp/docsearch-all-stable-full.log
5473
5574
./all-stable/scripts/check-crawl-errors.sh /tmp/docsearch-all-stable-full.log

.github/workflows/docsearch-all-stable-incremental.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ name: Doc Search Scripts (All Stable, Incremental)
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
scraper_repo:
7+
description: 'Docsearch-scraper repo used to patch workflow image'
8+
required: true
9+
default: 'https://github.com/shczhen/docsearch-scraper.git'
10+
type: string
11+
scraper_ref:
12+
description: 'Docsearch-scraper branch/ref used to patch workflow image'
13+
required: true
14+
default: 'incrementalCrawl'
15+
type: string
516

617
permissions:
718
contents: write
@@ -34,8 +45,19 @@ jobs:
3445
echo "APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}" >> .env
3546
echo "API_KEY=${{ secrets.ALGOLIA_API_KEY }}" >> .env
3647
echo "GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}" >> .env
37-
export DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}"
3848
export GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}
49+
50+
export BASE_DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}"
51+
export PATCH_SCRAPER_REPO="${{ inputs.scraper_repo }}"
52+
export PATCH_SCRAPER_REF="${{ inputs.scraper_ref }}"
53+
export PATCHED_DOCKER_REGISTRY="local"
54+
export PATCH_IMAGE_ENV_FILE="/tmp/docsearch-patched-image.env"
55+
56+
./all-stable/scripts/prepare-patched-scraper-image.sh "$(pwd)/all-stable"
57+
. "$PATCH_IMAGE_ENV_FILE"
58+
export DOCKER_REGISTRY="$PATCHED_DOCKER_REGISTRY"
59+
60+
echo "Run incremental crawl with patched image: $PATCHED_SCRAPER_IMAGE"
3961
./all-stable/scripts/crawl-incremental.sh "$(pwd)/all-stable" 2>&1 | tee /tmp/docsearch-all-stable-incremental.log
4062
4163
./all-stable/scripts/check-crawl-errors.sh /tmp/docsearch-all-stable-incremental.log

0 commit comments

Comments
 (0)