From bd0ae968c122dcd52c663a593455aa46eeb299f9 Mon Sep 17 00:00:00 2001 From: aurindam Date: Fri, 27 Sep 2024 14:01:58 +0200 Subject: [PATCH] Debug 8 --- .github/workflows/typesense-scrape.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/typesense-scrape.yml b/.github/workflows/typesense-scrape.yml index 26b065add..6e8a71284 100644 --- a/.github/workflows/typesense-scrape.yml +++ b/.github/workflows/typesense-scrape.yml @@ -4,10 +4,6 @@ name: Scrape a release with typesense on: workflow_dispatch: inputs: - relative_path: - type: string - default: "snapshots/master/docs/slint" - description: relative path to site root to scrape (like snapshots/master/docs/slint) version: type: string default: "master" @@ -19,6 +15,14 @@ jobs: steps: - name: Repository Checkout uses: actions/checkout@v4 + if: ${{ inputs.version == 'master' }} + with: + sparse-checkout: | + config + snapshots + - name: Repository Checkout + uses: actions/checkout@v4 + if: ${{ inputs.version != 'master' }} with: sparse-checkout: | config @@ -33,7 +37,12 @@ jobs: - name: Populate web server run: | docker exec nginx rm -rf /usr/share/nginx/html - docker cp ${{ inputs.relative_path }} nginx:/usr/share/nginx/html + if [ ${{ inputs.version == 'master' }} ] + path=snapshots/master/docs/slint + else + path=releases/${{ inputs.version }}/docs/slint + fi + docker cp $path nginx:/usr/share/nginx/html - name: test web server run: | curl http://localhost:80/index.html > test.html @@ -69,6 +78,9 @@ jobs: curl -H "X-TYPESENSE-API-KEY: ${{ secrets.TYPESENSE_API_KEY }}" \ "https://062ykax5pgwon3q7p-1.a1.typesense.net/collections/$collection_name/documents/export" > temp_docs.jsonl + # Replace 'http://host.docker.internal' in temp_docs.jsonl + $sed -i "s/http:\/\/host.docker.internal/https:\/\/releases.slint.dev\/${{ inputs.version }}\/docs\/slint/g" temp_docs.jsonl + # Update documents in typesense server curl -H "X-TYPESENSE-API-KEY: ${{ secrets.TYPESENSE_API_KEY }}" \ -X POST \