Skip to content

Scrape a release with typesense #11

Scrape a release with typesense

Scrape a release with typesense #11

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"
description: Slint version (used as typesense index name, for example "master")
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- name: Repository Checkout
uses: actions/checkout@v4
- name: Run
uses: tj-actions/docker-run@v2
id: docker-run
with:
name: nginx
image: nginx:latest
options: "-d -p 80:80"
- name: Populate web server
run: docker cp ${{ inputs.relative_path }} nginx:/usr/share/nginx/html
- name: Prepare config
run: |
sed -i "s/\$TYPESENSE_INDEX_NAME/${{ inputs.version }}/g" config/typesense-scraper-config.json
- name: run scraper
run: |
docker run -i \
-e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }} \
-e TYPESENSE_HOST="typesense.slint.dev" \
-e TYPESENSE_PORT="8101" \
-e TYPESENSE_PROTOCOL="http" \
-e CONFIG="$(cat config/typesense-scraper-config.json | jq -r tostring)" \
typesense/docsearch-scraper:0.10.0