-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(perf): make the action faster (#3)
## Summary Instead of using the docker image by algolia for docsearch, this pr uses the source repository for scrapping and uploading to algolia. ## Details Using the source repository, removes the use of jq, installation of docker-cli, the algolia docsearch docker image, and other peer dependencies. Using the python:3.6 as the base image (which comes with git preinstalled), first the algolia-docsearch repository is git cloned. pipenv is installed and then pipenv installed the packages in the Pipfile. ## Improvements The running time of the action has now reduced by 40 seconds. ## Further Comments I have made a few other fixes/corrections like correcting the spelling of algolia. Also, I changed the config.example.json since it took a lot of time to index and the difference could not have been made clear. Closes #2
- Loading branch information
1 parent
1eaef43
commit e3b8c55
Showing
6 changed files
with
46 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:latest | ||
FROM python:3.6 | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,20 @@ | ||
{ | ||
"index_name": "prod_EE", | ||
"index_name": "algolia_docsearch_action", | ||
"start_urls": [ | ||
{ | ||
"url": "https://docs.konghq.com/enterprise/(?P<version>.*?)/", | ||
"variables": { | ||
"version": { | ||
"url": "https://docs.konghq.com/enterprise/", | ||
"js": "var versions = $('ul[aria-labelledby=version-dropdown] a, button#version-dropdown').map(function(i, e) { return $(e).text().replace(/\\s+/g, '').replace(/Version/g, '').replace('(2020)', '').replace('(latest)', ''); }).toArray(); return JSON.stringify(versions);" | ||
} | ||
} | ||
} | ||
], | ||
"sitemap_urls": [ | ||
"https://docs.konghq.com/sitemap.xml" | ||
], | ||
"stop_urls": [ | ||
|
||
"https://aquaimpact.github.io/CovidSusTrackerDocs" | ||
], | ||
"stop_urls": [], | ||
"selectors": { | ||
"lvl0": { | ||
"selector": ".docs-navigation > a.active", | ||
"global": true, | ||
"default_value": "Kong" | ||
}, | ||
"lvl1": ".content h1", | ||
"lvl2": ".content h2", | ||
"lvl3": ".content h3", | ||
"lvl4": ".content h4", | ||
"text": ".content p, .content li" | ||
"lvl0": ".doc-content h1", | ||
"lvl1": ".doc-content h2", | ||
"lvl2": ".doc-content h3", | ||
"lvl3": ".doc-content h4", | ||
"lvl4": ".doc-content h5", | ||
"lvl5": ".doc-content h6", | ||
"text": ".doc-content p, .doc-content li" | ||
}, | ||
"selectors_exclude": [ | ||
"#next-steps", | ||
"#next-steps ~ p" | ||
], | ||
"only_content_level": true, | ||
"conversation_id": [ | ||
"534091583" | ||
"1313246279" | ||
], | ||
"nb_hits": 18645 | ||
} | ||
"nb_hits": 98 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters