From 5fbeab23932a0d007229bbc658836912d4023b67 Mon Sep 17 00:00:00 2001 From: vgelbgras <78641481+vgelbgras@users.noreply.github.com> Date: Fri, 24 May 2024 08:46:46 +0200 Subject: [PATCH 1/4] feat: make optional use latest index in landing page feat: make optional use latest index in landing page Update action.yml Update action.yml Update action.yml feat: make optional use latest index in landing page --- doc-deploy-dev/action.yml | 15 +++++++++++++++ doc-deploy-stable/action.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/doc-deploy-dev/action.yml b/doc-deploy-dev/action.yml index 59788bbeb..15cb00bfb 100644 --- a/doc-deploy-dev/action.yml +++ b/doc-deploy-dev/action.yml @@ -107,6 +107,14 @@ inputs: required: false default: 'main-content' type: string + + use-latest-index-in-landing-page: + description: > + Use the latest 'version/{stable|dev}/index.html' in the landing page. Default + value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. + required: false + default: true + type: string runs: using: "composite" @@ -255,6 +263,7 @@ runs: # ------------------------------------------------------------------------ - uses: ansys/actions/_logging@main + if: ${{ inputs.use-latest-index-in-landing-page == 'true' }} with: level: "INFO" message: > @@ -263,6 +272,7 @@ runs: - name: "Use the latest 'version/{stable|dev}/index.html' in the landing page" shell: bash + if: ${{ inputs.use-latest-index-in-landing-page == 'true' }} run: | if [[ -f 'version/stable/index.html' ]]; then cp version/stable/index.html index.html @@ -280,7 +290,12 @@ runs: - name: "Show the contents of the 'index.html' redirection file" shell: bash run: | + if [[ -f 'index.html' ]]; then cat index.html + else + echo "Error: The 'index.html' file does not exist." >&2 + exit 1 + fi # ------------------------------------------------------------------------ diff --git a/doc-deploy-stable/action.yml b/doc-deploy-stable/action.yml index ad59b05ea..fea4d2e6a 100644 --- a/doc-deploy-stable/action.yml +++ b/doc-deploy-stable/action.yml @@ -131,6 +131,14 @@ inputs: default: false type: boolean + use-latest-index-in-landing-page: + description: > + Use the latest 'version/{stable|dev}/index.html' in the landing page. Default + value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. + required: false + default: true + type: string + runs: using: "composite" steps: @@ -423,6 +431,7 @@ runs: # ------------------------------------------------------------------------ - uses: ansys/actions/_logging@main + if: ${{ inputs.use-latest-index-in-landing-page == 'true' }} with: level: "INFO" message: > @@ -430,6 +439,7 @@ runs: local href and source links to point to either the stable or dev version. - name: "Use the latest 'version/{stable|dev}/index.html' in the landing page" + if: ${{ inputs.use-latest-index-in-landing-page == 'true' }} shell: bash run: | if [[ -f 'version/stable/index.html' ]]; then @@ -448,7 +458,12 @@ runs: - name: "Show the contents of the 'index.html' redirection file" shell: bash run: | + if [[ -f 'index.html' ]]; then cat index.html + else + echo "Error: The 'index.html' file does not exist." >&2 + exit 1 + fi # ------------------------------------------------------------------------ From 01fa6c0f9bec76b97046defc7c00c04e1443cf3c Mon Sep 17 00:00:00 2001 From: vgelbgras <78641481+vgelbgras@users.noreply.github.com> Date: Fri, 24 May 2024 10:28:42 +0200 Subject: [PATCH 2/4] style: run pre-commit --- doc-deploy-dev/action.yml | 6 +++--- doc-deploy-stable/action.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc-deploy-dev/action.yml b/doc-deploy-dev/action.yml index 15cb00bfb..9f361b86b 100644 --- a/doc-deploy-dev/action.yml +++ b/doc-deploy-dev/action.yml @@ -107,11 +107,11 @@ inputs: required: false default: 'main-content' type: string - + use-latest-index-in-landing-page: description: > - Use the latest 'version/{stable|dev}/index.html' in the landing page. Default - value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. + Use the latest 'version/{stable|dev}/index.html' in the landing page. Default + value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. required: false default: true type: string diff --git a/doc-deploy-stable/action.yml b/doc-deploy-stable/action.yml index fea4d2e6a..f3e2eb9ce 100644 --- a/doc-deploy-stable/action.yml +++ b/doc-deploy-stable/action.yml @@ -133,8 +133,8 @@ inputs: use-latest-index-in-landing-page: description: > - Use the latest 'version/{stable|dev}/index.html' in the landing page. Default - value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. + Use the latest 'version/{stable|dev}/index.html' in the landing page. Default + value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. required: false default: true type: string From 54a5029ab1591897fe103204523f6f7a6814034a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rie=20Gelbgras?= <78641481+vgelbgras@users.noreply.github.com> Date: Fri, 24 May 2024 11:13:21 +0200 Subject: [PATCH 3/4] Update doc-deploy-dev/action.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jorge Martínez <28702884+jorgepiloto@users.noreply.github.com> --- doc-deploy-dev/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-deploy-dev/action.yml b/doc-deploy-dev/action.yml index 9f361b86b..60137e886 100644 --- a/doc-deploy-dev/action.yml +++ b/doc-deploy-dev/action.yml @@ -109,7 +109,7 @@ inputs: type: string use-latest-index-in-landing-page: - description: > + description: | Use the latest 'version/{stable|dev}/index.html' in the landing page. Default value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. required: false From 11b6a72ff43003f331f9869da244dcfd39fe48bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rie=20Gelbgras?= <78641481+vgelbgras@users.noreply.github.com> Date: Fri, 24 May 2024 11:13:44 +0200 Subject: [PATCH 4/4] Update doc-deploy-stable/action.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jorge Martínez <28702884+jorgepiloto@users.noreply.github.com> --- doc-deploy-stable/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-deploy-stable/action.yml b/doc-deploy-stable/action.yml index f3e2eb9ce..cd7fc4ae7 100644 --- a/doc-deploy-stable/action.yml +++ b/doc-deploy-stable/action.yml @@ -132,7 +132,7 @@ inputs: type: boolean use-latest-index-in-landing-page: - description: > + description: | Use the latest 'version/{stable|dev}/index.html' in the landing page. Default value is ``true``. By default, the index.html is overwritten by version/{stable|dev}/index.html. required: false