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/gh pages deployment #188

Merged
merged 8 commits into from
Jan 20, 2023
22 changes: 8 additions & 14 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
runs-on: [self-hosted, pyfluent]
env:
DOC_DEPLOYMENT_IMAGE_TAG: v23.1.0
DOCUMENTATION_CNAME: 'visualization.fluent.docs.pyansys.com'

steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -133,30 +135,22 @@ jobs:
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
DOCS_CNAME: fluentvisualization.docs.pyansys.com
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}

- name: Zip HTML Documentation before upload
run: |
sudo apt install zip -y
zip -r doc.zip doc/_build/html

- name: Upload HTML Documentation
uses: actions/upload-artifact@v3
with:
name: HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
path: doc.zip
path: doc/_build/html
retention-days: 7

- name: Deploy
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'dev')
uses: JamesIves/github-pages-deploy-[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: pyansys/actions/doc-deploy-stable@v3
with:
repository-name: pyansys/pyfluent-visualization-docs
token: ${{ steps.get_workflow_token.outputs.token }}
BRANCH: gh-pages
FOLDER: doc/_build/html
CLEAN: true
doc-artifact-name: 'HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}'
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}


build:
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/nightly-doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- cron: '0 4 * * *'
workflow_dispatch:

env:
DOCUMENTATION_CNAME: 'visualization.fluent.docs.pyansys.com'
DOC_DEPLOYMENT_IMAGE_TAG: v23.1.0

jobs:
nightly_docs_build:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -53,15 +57,23 @@ jobs:
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
DOCS_CNAME: dev.fluentvisualization.docs.pyansys.com
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

- name: Upload HTML Documentation
uses: actions/upload-artifact@v3
with:
name: HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
path: doc/_build/html

retention-days: 7

- name: Deploy
if: matrix.image-tag == 'v23.1.0'
uses: JamesIves/github-pages-deploy-[email protected]
uses: pyansys/actions/doc-deploy-dev@v3
with:
repository-name: pyansys/pyfluent-visualization-dev-docs
token: ${{ steps.get_workflow_token.outputs.token }}
BRANCH: gh-pages
FOLDER: doc/_build/html
CLEAN: true
doc-artifact-name: 'HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}'
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}



10 changes: 9 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

import ansys.fluent.core as pyfluent
from ansys_sphinx_theme import ansys_favicon, pyansys_logo_black
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black
import numpy as np
import pyvista
from sphinx_gallery.sorting import FileNameSortKey
Expand Down Expand Up @@ -37,6 +37,9 @@
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
author = "ANSYS Inc."

# Canonical name of the webpage (defined in the ci_cd.yml)
cname = os.getenv("DOCUMENTATION_CNAME", "visualization.fluent.docs.pyansys.com")

# The short X.Y version
release = version = __version__

Expand Down Expand Up @@ -176,6 +179,11 @@ def _stop_fluent_container(gallery_conf, fname):
html_theme = "ansys_sphinx_theme"
html_logo = pyansys_logo_black
html_theme_options = {
"switcher": {
"json_url": f"https://{cname}/release/versions.json",
"version_match": get_version_match(__version__),
},
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
"github_url": "https://github.com/pyansys/pyfluent-visualization",
"show_prev_next": False,
"show_breadcrumbs": True,
Expand Down