|
17 | 17 | - both |
18 | 18 | - en |
19 | 19 | - 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 |
20 | 35 |
|
21 | 36 | permissions: |
22 | 37 | contents: read |
@@ -49,14 +64,15 @@ jobs: |
49 | 64 | echo "APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }}" >> .env |
50 | 65 | echo "API_KEY=${{ secrets.ALGOLIA_API_KEY }}" >> .env |
51 | 66 | echo "GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }}" >> .env |
52 | | - export DOCKER_REGISTRY="${{ secrets.DOCKER_REGISTRY }}" |
53 | 67 | export GITHUB_AUTH_TOKEN=${{ secrets.GH_TOKEN }} |
54 | 68 |
|
55 | 69 | export CRAWL_LANG="${{ inputs.language }}" |
56 | 70 | PREVIEW_BASE_URL="${{ inputs.preview_base_url }}" |
57 | 71 | export CRAWL_LOCAL_URL="${PREVIEW_BASE_URL%/}/" |
| 72 | + export PREVIEW_RUNLIST_FILE="${{ inputs.preview_runlist }}" |
58 | 73 |
|
59 | 74 | echo "Run preview full prewarm against: $CRAWL_LOCAL_URL" |
| 75 | + echo "Use preview runlist file: $PREVIEW_RUNLIST_FILE" |
60 | 76 |
|
61 | 77 | preview_home_status="$(curl -sS -o /dev/null -w "%{http_code}" "$CRAWL_LOCAL_URL")" |
62 | 78 | if [ "$preview_home_status" != "200" ]; then |
|
69 | 85 | exit 1 |
70 | 86 | fi |
71 | 87 |
|
| 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" |
72 | 100 | ./all-stable/scripts/crawl-preview-full.sh "$(pwd)/all-stable" 2>&1 | tee /tmp/docsearch-all-stable-full-preview.log |
73 | 101 |
|
74 | 102 | ./all-stable/scripts/check-crawl-errors.sh /tmp/docsearch-all-stable-full-preview.log |
0 commit comments