Skip to content

Commit

Permalink
Debug 8
Browse files Browse the repository at this point in the history
  • Loading branch information
aurindam committed Sep 27, 2024
1 parent 383b336 commit bd0ae96
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/typesense-scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit bd0ae96

Please sign in to comment.