Skip to content

Commit

Permalink
ci: upload stable index
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto committed Sep 26, 2023
1 parent 3d2c32b commit a754f43
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ env:
PACKAGE_NAME: 'ansys-mapdl-core'
PACKAGE_NAMESPACE: 'ansys.mapdl.core'
DOCUMENTATION_CNAME: 'mapdl.docs.pyansys.com'
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
PYANSYS_OFF_SCREEN: True
DPF_START_SERVER: False
DPF_PORT: 21002
Expand Down Expand Up @@ -652,6 +654,34 @@ jobs:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
render-last: '5'

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: "get version of library"
shell: bash
run: |
echo "FULL_VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Scrape the stable documentation to PyMeilisearch
run: |
VERSION=$(python -c "import os; version=os.environ['FULL_VERSION']; print('.'.join(version.split('.')[:2]))")
VERSION_MEILI=$(python -c "import os; version=os.environ['FULL_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: pymapdl-v${{ env.VERSION_MEILI }}
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}

upload-dev-docs:
name: Upload dev documentation
if: github.ref == 'refs/heads/main' && !contains(github.ref, 'refs/tags')
Expand All @@ -675,4 +705,4 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
title-template: "Failed scheduled build"
label-name: "Nightly build failed"
label-name: "Nightly build failed"

0 comments on commit a754f43

Please sign in to comment.