Skip to content

Commit

Permalink
Merge pull request #9 from device42/DO-4165
Browse files Browse the repository at this point in the history
DO-4165 initial env based pipeline config
  • Loading branch information
mikeD42 authored Jul 27, 2023
2 parents 405c9f2 + 2ddba35 commit 89fbfa6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
environment: dev

steps:
- name: Checkout code
Expand All @@ -34,3 +35,23 @@ jobs:
- name: Sync to S3
run: aws s3 sync build/ s3://device42-docs-website-content-dev --size-only --delete

- name: Invalidate CF cache
run: |
INVAL_ID=$(aws cloudfront create-invalidation --distribution-id ${{ env.CF_DISTRO }} --paths "/*" | jq -r .Invalidation.Id )
aws cloudfront wait invalidation-completed --distribution-id ${{ env.CF_DISTRO }} --id $INVAL_ID
- name: Setup Algolia Config
id: algolia_config
run: |
sed -i 's/<INDEX_NAME>/${{ env.ALGOLIA_INDEX }}/g' algolia.json
sed -i 's/<FQDN>/${{ env.FQDN }}/g' algolia.json
echo "::set-output name=config::$(cat algolia.json | jq -r tostring)"
- name: Run Algolia Reindex
uses: signcl/docsearch-scraper-action@master
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
CONFIG: ${{ steps.algolia_config.outputs.config }}


39 changes: 39 additions & 0 deletions algolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"index_name": "<INDEX_NAME>",
"start_urls": ["https://<FQDN>"],
"sitemap_urls": ["https://<FQDN>/sitemap.xml"],
"ignoreNoIndex": "true",
"selectors": {
"lvl0": {
"selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]",
"type": "xpath",
"global": true,
"default_value": "Documentation"
},
"lvl1": "header h1",
"lvl2": "article h2",
"lvl3": "article h3",
"lvl4": "article h4",
"lvl5": "article h5, article td:first-child",
"lvl6": "article h6",
"text": "article p, article li, article td:last-child"
},
"strip_chars": " .,;:#",
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": [
"language",
"version",
"type",
"docusaurus_tag"
],
"attributesToRetrieve": [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type"
]
}
}

0 comments on commit 89fbfa6

Please sign in to comment.