From c5685077329cdd5af753b26a794e17f86865c5ce Mon Sep 17 00:00:00 2001 From: Stephen Fluin Date: Fri, 3 Nov 2023 14:11:57 -0500 Subject: [PATCH] fix: attempt to fix search github action --- .github/workflows/update-search.yml | 6 +++++- generate-search-index.js | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-search.yml b/.github/workflows/update-search.yml index 784fc9e45..0a54a9c53 100644 --- a/.github/workflows/update-search.yml +++ b/.github/workflows/update-search.yml @@ -7,7 +7,11 @@ jobs: update: runs-on: ubuntu-latest steps: + - name: Check out repository code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Make sure we have node and dependencies run: npm i - name: Process and send index updates to Algolia - run: npm run build-index + env: + ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }} + run: npm run generate-search-index diff --git a/generate-search-index.js b/generate-search-index.js index 2b69acbb0..e6df1fd7f 100644 --- a/generate-search-index.js +++ b/generate-search-index.js @@ -47,7 +47,7 @@ function walk(dir) { const fileContents = fs.readFileSync(filepath, "utf-8"); - console.log("about to parse", filepath); + // console.log("about to parse", filepath); // Get rid of frontmatter let data, content; @@ -114,7 +114,7 @@ function walk(dir) { walk("src/pages"); -console.dir(sitemap, { maxArrayLength: null }); +//console.dir(sitemap, { maxArrayLength: null }); try { index diff --git a/package.json b/package.json index e589c8d29..8c497790c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build": "astro build", "preview": "astro preview", "astro": "astro", - "build-index": "node ./generate-search-index.js" + "generate-search-index": "node ./generate-search-index.js" }, "dependencies": { "@astrojs/markdown-remark": "^3.2.0",