From 49de9634b2b6e6d2beaec96759b40de85422499d Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:23:12 +0200 Subject: [PATCH] Test typesense step (#1757) --- .github/workflows/docs.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 131ccccddb..aed3cb3987 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 @@ -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'