Skip to content

Commit b3fd4f2

Browse files
authored
Merge branch 'main' into json-encoder
2 parents 1fbdc34 + 3b8829a commit b3fd4f2

2 files changed

Lines changed: 47 additions & 7 deletions

File tree

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
11
name: Documentation
2+
23
on:
34
push:
45
tags:
56
- v*
7+
# Allows to run the workflow manually
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
env:
23+
CUSTOM_DOMAIN: python-sdk.meilisearch.com
624

725
jobs:
8-
docs:
26+
build:
927
runs-on: ubuntu-latest
1028
steps:
1129
- uses: actions/checkout@v3
1230
with:
1331
fetch-depth: 0
1432
lfs: true
33+
- name: Setup Github Pages
34+
uses: actions/configure-pages@v3
1535
- name: Install Python
1636
uses: actions/setup-python@v4
1737
with:
18-
python-version: '3.10'
38+
python-version: "3.10"
1939
- name: Install pipenv
2040
run: |
2141
pip install pipx
@@ -29,9 +49,22 @@ jobs:
2949
run: |
3050
pipenv run sphinx-apidoc -f -o docs meilisearch/
3151
pipenv run sphinx-build docs ./docs/_build/html/
32-
- name: Deploy
33-
uses: peaceiris/actions-gh-pages@v3
52+
# CNAME file is required for GitHub pages custom domain
53+
- name: Create CNAME file
54+
run: |
55+
echo "$CUSTOM_DOMAIN" > ./docs/_build/html/CNAME
56+
echo "Created CNAME in ./docs/_build/html/: $CUSTOM_DOMAIN"
57+
- name: Upload artifacts
58+
uses: actions/upload-pages-artifact@v2
3459
with:
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: docs/_build/html
37-
force_orphan: true
60+
path: "./docs/_build/html"
61+
deploy:
62+
needs: build
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v2

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,10 @@
5757

5858
# This value contains a list of modules to be mocked up.
5959
autodoc_mock_imports = ["camel_converter"]
60+
61+
html_title = 'Meilisearch Python | Documentation'
62+
63+
# Add Fathom analytics script
64+
html_js_files = [
65+
("https://cdn.usefathom.com/script.js", { "data-site": "QNBPJXIV", "defer": "defer" })
66+
]

0 commit comments

Comments
 (0)