-
Notifications
You must be signed in to change notification settings - Fork 17
49 lines (37 loc) · 1.41 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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/