Skip to content

Commit 41254a1

Browse files
committed
Add Algolia indexing to CI
1 parent 73e8fac commit 41254a1

File tree

7 files changed

+491
-0
lines changed

7 files changed

+491
-0
lines changed

.circleci/config.yml

+23
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,22 @@ jobs:
387387
docker push hashicorp/consul-website
388388
fi
389389
390+
algolia-index:
391+
docker:
392+
- image: node:12
393+
steps:
394+
- checkout
395+
- run:
396+
name: Push content to Algolia Index
397+
command: |
398+
if [ "$CIRCLE_REPOSITORY_URL" != "[email protected]:hashicorp/consul.git" ]; then
399+
echo "Not Consul OSS Repo, not indexing Algolia"
400+
exit 0
401+
fi
402+
cd website/
403+
npm install
404+
node scripts/index_search_content.js
405+
390406
# build frontend yarn cache
391407
frontend-cache:
392408
docker:
@@ -708,6 +724,13 @@ workflows:
708724
branches:
709725
only:
710726
- master
727+
728+
- algolia-index:
729+
context: consul-docs
730+
filters:
731+
branches:
732+
only:
733+
- stable-website
711734
frontend:
712735
jobs:
713736
- frontend-cache:

package-lock.json

+217
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/.env

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
NEXT_PUBLIC_SEGMENT_WRITE_KEY='IyzLrqXkox5KJ8XL4fo8vTYNGfiKlTCm'
22
NEXT_PUBLIC_BUGSNAG_CLIENT_KEY='01625078d856ef022c88f0c78d2364f1'
33
NEXT_PUBLIC_BUGSNAG_SERVER_KEY='be8ed0d0fc887d547284cce9e98e60e5'
4+
NEXT_PUBLIC_ALGOLIA_APP_ID=YY0FFNI7MF
5+
NEXT_PUBLIC_ALGOLIA_INDEX=product_CONSUL
6+
NEXT_PUBLIC_ALGOLIA_SEARCH_ONLY_API_KEY=5037da4824714676226913c65e961ca0

website/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ node_modules
33
.next
44
out
55
.mdx-data
6+
7+
# As per Next.js conventions (https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables)
8+
.env*.local

0 commit comments

Comments
 (0)