Add to team (#99) #43
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
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: # manual trigger for testing | |
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_original.json from docs site | |
run: curl -O https://raw.githubusercontent.com/TuringLang/docs/gh-pages/search_original.json | |
- name: Convert docs site search index URLs to relative URLs | |
run: | | |
jq 'map( | |
if .href then .href = "docs/" + .href else . end | | |
if .objectID then .objectID = "docs/" + .objectID else . end)' search_original.json > fixed_docs_search.json | |
- name: Merge both search index | |
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 | |
clean: false # we need this to preserve the old versions of Turing docs, e.g. library/ |