-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.49 KB
/
typesense-scrape.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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: test web server
run: curl http://localhost:80/index.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="062ykax5pgwon3q7p-1.a1.typesense.net" \
-e TYPESENSE_PORT="443" \
-e TYPESENSE_PROTOCOL="https" \
-e CONFIG="$(cat config/typesense-scraper-config.json | jq -r tostring)" \
typesense/docsearch-scraper:0.10.0