diff --git a/.github/workflows/typesense.yaml b/.github/workflows/typesense.yaml new file mode 100644 index 0000000..fa7956b --- /dev/null +++ b/.github/workflows/typesense.yaml @@ -0,0 +1,29 @@ +name: typesense +on: + # Once a week on Wednesday at 11:45 UTC + schedule: + - cron: '45 11 * * 3' + # Or after a deployment + push: + branches: + - main + - typesense + # Or manually + workflow_dispatch: +jobs: + typesense: + name: Update Typesense + if: ${{ github.repository_owner == 'qunitjs' }} # skip on forks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Docsearch Scraper + shell: bash + run: | + docker run \ + -e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_ADMIN_KEY }} \ + -e TYPESENSE_HOST="${{ secrets.TYPESENSE_HOST }}" \ + -e TYPESENSE_PORT="443" \ + -e TYPESENSE_PROTOCOL="https" \ + -e CONFIG="$(cat docsearch.config.json | jq -r tostring)" \ + typesense/docsearch-scraper:0.6.0.rc2 diff --git a/docsearch.config.json b/docsearch.config.json new file mode 100644 index 0000000..976dbfc --- /dev/null +++ b/docsearch.config.json @@ -0,0 +1,60 @@ +{ + "index_name": "amethyst_demo", + "start_urls": [ + { "url": "https://qunitjs.github.io/jekyll-theme-amethyst/api/", "selectors_key": "api", "page_rank": 20 }, + { "url": "https://qunitjs.github.io/jekyll-theme-amethyst/\\d{4}/", "selectors_key": "blog", "page_rank": 1 }, + { "url": "https://qunitjs.github.io/jekyll-theme-amethyst/", "page_rank": 10 } + ], + "stop_content": [ + "