Skip to content

Commit

Permalink
Test typesense step (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Sep 6, 2023
1 parent 31b296d commit 49de963
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
with:
path: ./public

- name: Upload tutorials search file
uses: actions/upload-pages-artifact@v1
with:
name: tutorials-search-file
path: ./public/tutorials/typesense.json

deploy:
environment:
name: github-pages
Expand All @@ -52,6 +58,29 @@ jobs:
id: deployment
uses: actions/deploy-pages@v1

upload-tutorials-page-entries:
needs: build
runs-on: ubuntu-latest
if: github.repository_owner == 'viamrobotics'
steps:
- name: Download the tutorials search file
uses: actions/download-artifact@v3
with:
name: tutorials-search-file
- name: Write env
run: |
echo TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }} > typesense.env
echo TYPESENSE_HOST=cgnvrk0xwyj9576lp-1.a1.typesense.net >> typesense.env
echo TYPESENSE_PORT=443 >> typesense.env
echo TYPESENSE_PROTOCOL=https >> typesense.env
- name: Upload tutorials documents
run: |
jq -c '.[]' typesense.json > documents.jsonl
curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-X POST \
-T documents.jsonl \
"https://cgnvrk0xwyj9576lp-1.a1.typesense.net/collections/tutorials/documents/import?action=upsert"
generate-index:
needs: build
if: github.repository_owner == 'viamrobotics'
Expand Down

0 comments on commit 49de963

Please sign in to comment.