Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make optional use latest index in landing page #493

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
15 changes: 15 additions & 0 deletions doc-deploy-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ inputs:
default: 'main-content'
type: string

use-latest-index-in-landing-page:
description: >
vgelbgras marked this conversation as resolved.
Show resolved Hide resolved
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:
Expand Down Expand Up @@ -255,6 +263,7 @@ runs:
# ------------------------------------------------------------------------

- uses: ansys/actions/_logging@main
if: ${{ inputs.use-latest-index-in-landing-page == 'true' }}
with:
level: "INFO"
message: >
Expand All @@ -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
Expand All @@ -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

# ------------------------------------------------------------------------

Expand Down
15 changes: 15 additions & 0 deletions doc-deploy-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ inputs:
default: false
type: boolean

use-latest-index-in-landing-page:
description: >
vgelbgras marked this conversation as resolved.
Show resolved Hide resolved
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:
Expand Down Expand Up @@ -423,13 +431,15 @@ runs:
# ------------------------------------------------------------------------

- uses: ansys/actions/_logging@main
if: ${{ inputs.use-latest-index-in-landing-page == 'true' }}
with:
level: "INFO"
message: >
Copy the index.html from the stable version and update all
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
Expand All @@ -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

# ------------------------------------------------------------------------

Expand Down
Loading