Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ env:
STABLE_REVN: '231' # ensure this matches inputs.stable-revn.default
EXPERIMENTAL_REVN: '232' # ensure this matches inputs.experimental-revn.default
DEV_REVN: '241'
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_HOST_URL: ${{ vars.MEILISEARCH_HOST_URL }}
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -599,6 +602,21 @@ jobs:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

doc-index-dev:
name: "Deploy dev index docs"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: upload_dev_docs
steps:
- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
index-name: pymechanical-vdev
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

upload_docs_release:
name: Upload release documentation
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
Expand All @@ -610,4 +628,32 @@ jobs:
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

doc-index-stable:
name: "Deploy stable docs index"
runs-on: ubuntu-latest
needs: upload_docs_release
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4

- name: "Install the package requirements"
run: pip install -e .

- name: "Get the version to PyMeilisearch"
run: |
VERSION=$(python -c "from ansys.mechanical.core import __version__; print('.'.join(__version__.split('.')[:2]))")
VERSION_MEILI=$(python -c "from ansys.mechanical.core import __version__; print('-'.join(__version__.split('.')[:2]))")
echo "Calculated VERSION: $VERSION"
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV

- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
index-name: pymechanical-v${{ env.VERSION_MEILI }}
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG](https://kee

- Add codeql.yml for security checks ([#423](https://github.com/ansys/pymechanical/pull/423))
- add readonly flag and assertion ([#441](https://github.com/ansys/pymechanical/pull/441))
- Add PyMeilisearch in documentation ([#508](https://github.com/ansys/pymechanical/pull/508))

### Fixed

Expand Down
7 changes: 6 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
"thumbnail_size": (350, 350),
}


# -- Options for HTML output -------------------------------------------------
html_short_title = html_title = "PyMechanical"
html_theme = "ansys_sphinx_theme"
Expand Down Expand Up @@ -204,6 +203,12 @@
"icon": "fa fa-comment fa-fw",
},
],
"use_meilisearch": {
"api_key": os.getenv("MEILISEARCH_PUBLIC_API_KEY", ""),
"index_uids": {
f"pymemchanical-v{get_version_match(version).replace('.', '-')}": "PyMechanical",
},
},
}

# -- Options for HTMLHelp output ---------------------------------------------
Expand Down