Skip to content

revert search change #5658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/update-search.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update search index
on:
workflow_dispatch:

jobs:
update-search:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git submodule update --init
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Dump Identity
run: |
mkdir -p ~/.config/dfx/identity/default
echo $DFX_IDENTITY_PREVIEW | base64 -d > ~/.config/dfx/identity/default/identity.pem
env:
DFX_IDENTITY_PREVIEW: ${{ secrets.DFX_IDENTITY_PREVIEW }}

- name: Build website
run: |
npm install
npm run build
env:
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
CONTENTFUL_HOST: ${{ secrets.CONTENTFUL_HOST }}
CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
AIRTABLE_KEY: ${{ secrets.AIRTABLE_SA_PORTAL_SERVICE_ACCOUNT }}
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}

- name: Remove redirect pages
run: |
rm -rf build/bitcoin-integration/
# Other redirects to remove

- name: Update search index
run: |
cd search/src/doc_generator
pip install -r requirements.txt
cd ../../..
python search/src/doc_generator/generate-docs.py "./build/**/*.html"
cd search

cargo run --release --bin search-cli -- index ../docs.json stopwords.txt output.json
cargo run --release --bin search-cli -- upload output.json stopwords.txt 5qden-jqaaa-aaaam-abfpa-cai ~/.config/dfx/identity/default/identity.pem
14 changes: 1 addition & 13 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ const config = {
organizationName: "dfinity",
projectName: "portal",
customFields: {
searchCanisterId: "5qden-jqaaa-aaaam-abfpa-cai",
marketingNav,
},
markdown: {
Expand Down Expand Up @@ -691,19 +692,6 @@ const config = {
// but to do that type preset- classic had to be disabled below
// /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
{
algolia: {
// The application ID provided by Algolia
appId: 'B0O3KB7MGW',

// Public API key: it is safe to commit it
apiKey: '43d8a7a6f4697a580cdf0cb021affddb',

indexName: 'internetcomputer',

contextualSearch: true,

insights: true,
},
image: "/img/share.webp",
colorMode: {
disableSwitch: false,
Expand Down
57 changes: 37 additions & 20 deletions package-lock.json

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

Loading