Skip to content

modifies workflow to update search.json for searching docs (#70) #16

modifies workflow to update search.json for searching docs (#70)

modifies workflow to update search.json for searching docs (#70) #16

Workflow file for this run

on:
push:
branches:
- main
name: Deploy to GitHub Pages
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- run: quarto --version
- name: Render Quarto site
run: quarto render
- name: Rename original search index
run: mv _site/search.json _site/search_original.json
- name: Install jq
run: sudo apt-get install jq
- name: Fetch search.json from docs site
run: curl -O https://raw.githubusercontent.com/TuringLang/docs/gh-pages/search.json
- name: Fix URLs in docs site search index
run: |
jq 'map(if .href then .href = "docs/" + .href else . end) |
map(if .objectID then .objectID = "docs/" + .objectID else . end)' search.json > fixed_docs_search.json
- name: Merge search indices
run: |
jq -s '.[0] + .[1]' _site/search_original.json fixed_docs_search.json > _site/search.json
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: _site