Skip to content

Commit

Permalink
exec docsearch script with ts-node
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed May 13, 2022
1 parent 0e84cc8 commit 0bc9bcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docsearch-crawl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ jobs:
steps:
- name: Checkout codebase
uses: actions/checkout@v2
- name: Install node and ts-node
uses: actions/setup-node@v2
with:
node-version: "14"
- run: npm install -g ts-node
- name: Crawl the site
env:
APPLICATION_ID: ${{ secrets.DOCSEARCH_APP_ID }}
API_KEY: ${{ secrets.DOCSEARCH_API_KEY }}
run: |
docker run \
-e APPLICATION_ID -e API_KEY \
-e CONFIG="$(node .github/workflows/docsearchConfigScript.js | cat .github/workflows/docsearchConfig.json)" \
-e CONFIG="$(ts-node -O '{\"module\": \"commonjs\"}' .github/workflows/docsearchConfigScript.js | cat .github/workflows/docsearchConfig.json)" \
algolia/docsearch-scraper:v1.6.0
2 changes: 1 addition & 1 deletion .github/workflows/docsearchConfigScript.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs")
const translations = require("../../src/data/translations.json")
const translations = require("../../src/utils/languages").default

var config = {
index_name: "prod-ethereum-org",
Expand Down

0 comments on commit 0bc9bcf

Please sign in to comment.