-
Notifications
You must be signed in to change notification settings - Fork 97
docs: Add Search to website using Algolia #1082
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
Conversation
Signed-off-by: amanycodes <amanycodes@gmail.com>
website/docusaurus.config.js
Outdated
@@ -80,6 +80,12 @@ const config = { | |||
theme: lightCodeTheme, | |||
darkTheme: darkCodeTheme, | |||
}, | |||
algolia: { | |||
appId: 'V764HJRQUN', | |||
apiKey: 'd590e629131c1318f2b996bc14efdfa8', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing a different Search API key on the site? Also I've added the one I see as a repo secret ALGOLIA_API_KEY
. I also stored app id as ALGOLIA_ID
. Lets use these instead of hardcoding it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more question - would there be any way of testing this before we merge the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing a different Search API key on the site? Also I've added the one I see as a repo secret
ALGOLIA_API_KEY
. I also stored app id asALGOLIA_ID
. Lets use these instead of hardcoding it
Sure, using variables makes sense! I still see the current API key on the site. Also will a video demo of the search working on my local machine work as valid test of the search working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amanycodes sure - can you try with both keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Please share the other key through Slack as I can't view the repo secrets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashnamehrotra Also I was wondering should I push the .env
holding key and id values? Since people pulling changes will also need them anyways for them to run the website locally? Or else we'd have to like mention it somewhere explicitly..WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amanycodes thanks! I don't think we should expose any key values in the repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amanycodes can we change it to the github secrets vars? I'll remove the comment from above since it exposes the key
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1082 +/- ##
=======================================
Coverage 43.28% 43.28%
=======================================
Files 21 21
Lines 3301 3301
=======================================
Hits 1429 1429
Misses 1763 1763
Partials 109 109 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
@ashnamehrotra Are the github secret vars not updated for Algolia search? |
they are updated, can you try running an echo in the workflow to debug? |
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
@ashnamehrotra I still can't figure out how do i access the variables, i have echoed both secrets and vars and they both dont have the required vars. Maybe the workflow doesn't have access to those variables or something. Please let me know where am i going wrong 🤔 |
@amanycodes are the keys also stored in your fork of copa? |
I checked and there were no keys stored in my fork. Are the workflows trying to fetch from my repo's variables? |
@amanycodes I'm not sure but if possible we can test that way? we can also change the workflow type to trigger, and then run on your fork |
sure! I'll just add these vars to my fork and check. |
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
@ashnamehrotra I tested by storing keys in my fork and running the doc workflow there and I could see the keys in the echo. workflow link: https://github.com/amanycodes/copacetic/actions/runs/15567823815/job/43836147476 I used this stackoverflow reference for secret creation: https://stackoverflow.com/questions/67964110/how-to-access-secrets-when-using-flutter-web-with-github-actions/67998780#67998780 |
@amanycodes I created the secrets again to confirm they are there. Can we double check any permissions for the workflow and site? |
Signed-off-by: amanycodes <amanycodes@gmail.com>
A fork can't access the main repo's environment variables. Assuming this is all tested on a fork with fork's env vars, these should work after we merge the PR as long as we have the same env vars in main repo. |
Thanks for the clarification! we were stuck on this for quite sometime. I will reset the perms whichever I changed and here is the working check on my fork: |
Signed-off-by: amanycodes <amanycodes@gmail.com>
Let's merge it, and we can fix it afterwards if it's still broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
looks like it's all working now, thanks @amanycodes! |
Added search capability in website using Algolia DocSearch.
I think the stock template looks good, and we can use that without any UI changes!
Closes: #320