Skip to content

Commit

Permalink
feat: Add support for new search with Algolia (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-knott authored Aug 3, 2023
1 parent 9507647 commit 12644a1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Retrieve segment write key (Production)
- name: Retrieve build-time environment variables (Production)
run: |
source <(curl -sL http://ci.q-ctrl.com)
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
./ci vault get -k SEGMENT_WRITE_KEY -t $(cat .token) -p secret/data/python/prod -o ./docs/SEGMENT_WRITE_KEY
./ci vault get -k DOCSEARCH_APP_ID -t $(cat .token) -p secret/data/python/prod -o ./docs/DOCSEARCH_APP_ID
./ci vault get -k DOCSEARCH_API_KEY -t $(cat .token) -p secret/data/python/prod -o ./docs/DOCSEARCH_API_KEY
./ci vault get -k DOCSEARCH_INDEX_NAME -t $(cat .token) -p secret/data/python/prod -o ./docs/DOCSEARCH_INDEX_NAME
- name: Build Sphinx Image and Push to DockerHub
run: |
./ci vault get -t $(cat .token) -p secret/data/dockerhub -k hub_user -o .hub_user
Expand Down
3 changes: 3 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ RUN /scripts/install-python-dependencies.sh
WORKDIR /docs

RUN SEGMENT_WRITE_KEY=$([ -f SEGMENT_WRITE_KEY ] && cat SEGMENT_WRITE_KEY) \
DOCSEARCH_APP_ID=$([ -f DOCSEARCH_APP_ID ] && cat DOCSEARCH_APP_ID) \
DOCSEARCH_API_KEY=$([ -f DOCSEARCH_API_KEY ] && cat DOCSEARCH_API_KEY) \
DOCSEARCH_INDEX_NAME=$([ -f DOCSEARCH_INDEX_NAME ] && cat DOCSEARCH_INDEX_NAME) \
poetry run make html

FROM qctrl/ci-images:nginx-base
Expand Down
11 changes: 2 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from typing import List

import tomli
from qctrlsphinxtheme import get_html_theme_options

import qctrlopencontrols

Expand Down Expand Up @@ -81,15 +82,7 @@
html_theme = "qctrl_sphinx_theme"

# Theme options
html_theme_options = {
# Toc options
"collapse_navigation": False,
"includehidden": False,
}

segment_write_key = os.getenv("SEGMENT_WRITE_KEY", "")
if segment_write_key != "":
html_theme_options["segment_write_key"] = segment_write_key
html_theme_options = get_html_theme_options()

# Option to automatically generate summaries.
autosummary_generate = True
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ mypy = "^1.4.1"
pre-commit = "^3.3.3"
pylint = "^2.17.4"
pytest = "^7.4.0"
qctrl-sphinx-theme = "~0.2.0"
qctrl-sphinx-theme = "~1.0.1"
sphinx = "^5.0.0"
tomli = "^2.0.1"

Expand Down

0 comments on commit 12644a1

Please sign in to comment.