Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: npm install --global vercel@latest
- run: rm -rf .vercel
- name: Pull Vercel Environment Information
run: vercel pull --yes --git-branch=release/1.0 --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --git-branch=main --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: BASE_URL=https://next.renative.org ALGOLIA_INDEX=renative_docsearch vercel build
- name: Deploy Project Artifacts to Vercel
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Vercel Prod Deployment

on:
push:
branches:
- release

jobs:
release:
runs-on: ubuntu-latest
environment: vercel-deployments
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Set scraper config environment variable
id: scraper_config
run: |
export SCRAPER_CONFIG=$(cat ./config.prod.json | jq -r tostring)
echo "scraper_config=${SCRAPER_CONFIG}" >> $GITHUB_OUTPUT
- name: Install Vercel CLI
run: npm install --global vercel@latest
- run: rm -rf .vercel
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: BASE_URL=https://renative.org ALGOLIA_INDEX=renative_docsearch vercel build
- name: Deploy Project Artifacts to Vercel
run: |
url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel alias --token=${{ secrets.VERCEL_TOKEN }} --scope=${{ secrets.VERCEL_ORG_ID }} set "$url" renative.org
- name: Update Algolia index
uses: addnab/docker-run-action@v3
with:
image: algolia/docsearch-scraper
run: |
CONFIG='${{ steps.scraper_config.outputs.scraper_config }}' APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} API_KEY=${{ secrets.ALGOLIA_API_KEY }} pipenv run python -m src.index
24 changes: 4 additions & 20 deletions config.next.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"index_name": "renative_docsearch",
"sitemap_urls": [
"https://next.renative.org/sitemap.xml"
],
"sitemap_urls": ["https://next.renative.org/sitemap.xml"],
"selectors": {
"lvl0": {
"selector": "header h1, article h1",
Expand Down Expand Up @@ -46,21 +44,7 @@
"unordered(content)",
"unordered(anchor)"
],
"attributesToRetrieve": [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type"
],
"ranking": [
"words",
"filters",
"typo",
"exact",
"attribute",
"proximity"
]
"attributesToRetrieve": ["hierarchy", "content", "anchor", "url", "url_without_anchor", "type"],
"ranking": ["words", "filters", "typo", "exact", "attribute", "proximity"]
}
}
}
50 changes: 50 additions & 0 deletions config.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"index_name": "renative_docsearch",
"sitemap_urls": ["https://renative.org/sitemap.xml"],
"selectors": {
"lvl0": {
"selector": "header h1, article h1",
"global": true,
"default_value": "Documentation"
},
"lvl1": "article h2",
"lvl2": "article h3",
"lvl3": "article h4",
"lvl4": "article h5, article td:first-child",
"lvl5": "article h6",
"content": "article p, article li, article td:last-child"
},
"strip_chars": " .,;:#",
"custom_settings": {
"searchableAttributes": [
"unordered(hierarchy.lvl0)",
"unordered(hierarchy_radio.lvl0)",
"unordered(hierarchy_camel.lvl0)",
"unordered(hierarchy_radio_camel.lvl0)",
"unordered(hierarchy.lvl1)",
"unordered(hierarchy_radio.lvl1)",
"unordered(hierarchy_camel.lvl1)",
"unordered(hierarchy_radio_camel.lvl1)",
"unordered(hierarchy.lvl2)",
"unordered(hierarchy_radio.lvl2)",
"unordered(hierarchy_camel.lvl2)",
"unordered(hierarchy_radio_camel.lvl2)",
"unordered(hierarchy.lvl3)",
"unordered(hierarchy_radio.lvl3)",
"unordered(hierarchy_camel.lvl3)",
"unordered(hierarchy_radio_camel.lvl3)",
"unordered(hierarchy.lvl4)",
"unordered(hierarchy_radio.lvl4)",
"unordered(hierarchy_camel.lvl4)",
"unordered(hierarchy_radio_camel.lvl4)",
"unordered(hierarchy.lvl5)",
"unordered(hierarchy_radio.lvl5)",
"unordered(hierarchy_camel.lvl5)",
"unordered(hierarchy_radio_camel.lvl5)",
"unordered(content)",
"unordered(anchor)"
],
"attributesToRetrieve": ["hierarchy", "content", "anchor", "url", "url_without_anchor", "type"],
"ranking": ["words", "filters", "typo", "exact", "attribute", "proximity"]
}
}