Skip to content

Commit 6e98090

Browse files
Feat: add actions for pymeilisearch indexing (#271)
Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent 9d415f5 commit 6e98090

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These owners will be the default owners for everything in the repo. Unless a
2+
# later match takes precedence, the PyAnsys Core team will be requested for
3+
# review when someone opens a pull request.
4+
* @ansys/pyansys-core

.github/workflows/ci_cd.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
PACKAGE_NAMESPACE: 'ansys_sphinx_theme'
1515
DOCUMENTATION_CNAME: 'sphinxdocs.ansys.com'
1616
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
17+
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
1718

1819
concurrency:
1920
group: ${{ github.workflow }}-${{ github.ref }}
@@ -82,7 +83,7 @@ jobs:
8283
fail-fast: false
8384
matrix:
8485
os: [ubuntu-latest, windows-latest, macos-latest]
85-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
86+
python-version: ['3.8', '3.9', '3.10', '3.11']
8687
should-release:
8788
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
8889
exclude:
@@ -132,3 +133,48 @@ jobs:
132133
uses: ansys/actions/release-github@v4
133134
with:
134135
library-name: ${{ env.PACKAGE_NAME }}
136+
137+
doc-index-dev:
138+
name: "Deploy dev index docs"
139+
if: github.ref == 'refs/heads/main'
140+
runs-on: ubuntu-latest
141+
needs: doc-deploy-development
142+
steps:
143+
- name: "Deploy the latest documentation index"
144+
uses: ansys/actions/doc-deploy-index@v4
145+
with:
146+
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
147+
index-name: "ansys-sphinx-theme-vdev"
148+
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
149+
api-key: ${{ env.MEILISEARCH_API_KEY }}
150+
151+
doc-index-stable:
152+
name: "Deploy stable docs index"
153+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
154+
runs-on: ubuntu-latest
155+
needs: doc-deploy-stable
156+
steps:
157+
- name: "Install Git and clone project"
158+
uses: actions/checkout@v3
159+
160+
- name: "get version of library"
161+
shell: bash
162+
run: |
163+
python -m pip install -e .
164+
165+
- name: Scrape the stable documentation to PyMeilisearch
166+
run: |
167+
VERSION=$(python -c "from ${{ env.PACKAGE_NAMESPACE }} import __version__; print('.'.join(__version__.split('.')[:2]))")
168+
VERSION_MEILI=$(python -c "from ${{ env.PACKAGE_NAMESPACE }} import __version__; print('-'.join(__version__.split('.')[:2]))")
169+
echo "Calculated VERSION: $VERSION"
170+
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
171+
echo "VERSION=$VERSION" >> $GITHUB_ENV
172+
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV
173+
174+
- name: "Deploy the latest documentation index"
175+
uses: ansys/actions/doc-deploy-index@v4
176+
with:
177+
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
178+
index-name: ansys-sphinx-theme-v${{ env.VERSION_MEILI }}
179+
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
180+
api-key: ${{ env.MEILISEARCH_API_KEY }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 ANSYS, Inc. All rights reserved.
3+
Copyright (c) 2022-2023 ANSYS, Inc. and/or its affiliates.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ansys Sphinx theme
66
:target: https://github.com/ansys
77
:alt: Ansys
88

9-
.. |python| image:: https://img.shields.io/badge/Python-%3E%3D3.7-blue
9+
.. |python| image:: https://img.shields.io/badge/Python-%3E%3D3.8-blue
1010
:target: https://pypi.org/project/ansys-sphinx-theme/
1111
:alt: Python
1212

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"version_match": get_version_match(__version__),
6060
},
6161
"use_meilisearch": {
62-
"api_key": os.getenv("MEILISEARCH_API_KEY", ""),
62+
"api_key": os.getenv("MEILISEARCH_PUBLIC_API_KEY", ""),
6363
"index_uids": {
6464
f"ansys-sphinx-theme-v{convert_version_to_pymeilisearch(__version__)}": "ansys-sphinx-theme", # noqa: E501
6565
},

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name = "ansys-sphinx-theme"
88
dynamic = ["version"]
99
description = "A theme devised by ANSYS, Inc. for Sphinx documentation."
1010
readme = "README.rst"
11-
requires-python = ">=3.7"
11+
requires-python = ">=3.8,<4"
1212
license = {file = "LICENSE"}
1313
authors = [
1414
{name = "ANSYS, Inc.", email = "[email protected]"},

0 commit comments

Comments
 (0)