Skip to content

Commit

Permalink
CI: set up multi-version workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto committed Dec 16, 2022
1 parent a32b3f2 commit 9843ab0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ concurrency:

env:
ANSYS_VERSION: 232
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
MAIN_PYTHON_VERSION: '3.8'

jobs:
debug:
Expand All @@ -41,7 +43,7 @@ jobs:
- name: "Setup Python"
uses: actions/setup-python@v4.2.0
with:
python-version: 3.8
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install style requirements"
run: |
Expand Down Expand Up @@ -83,6 +85,17 @@ jobs:
custom-requirements: ''
secrets: inherit

upload-development-docs:
runs-on: ubuntu-latest
if: startsWith(github.head_ref, 'master')
needs: [docs]
steps:
- name: "Upload development documentation"
uses: pyansys/actions/doc-deploy-dev@v2
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

examples:
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/examples.yml
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,9 @@ jobs:
name: HTML-doc-${{env.PACKAGE_NAME}}
path: HTML-doc-${{env.PACKAGE_NAME}}.zip
if: always()

- name: "Upload HTML Documentation"
uses: actions/upload-artifact@v3
with:
name: documentation-html
path: docs/build/html
55 changes: 18 additions & 37 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,11 @@ on:
release:
types: [published]

jobs:
Deploy_Documentation:
name: "Deploy live documentation"
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v3
env:
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
PYTHON_MAIN_VERSION: '3.10'

- name: "Get the version"
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: "Download Release Asset - HTML"
uses: dsaltares/fetch-gh-release-asset@1.0.0
with:
file: HTML-doc-ansys-dpf-core.zip
token: ${{ secrets.GITHUB_TOKEN }}

- name: "Unzip the HMTL documentation"
uses: montudor/action-zip@v1
with:
args: unzip -qq HTML-doc-ansys-dpf-core.zip -d HTML-doc-ansys-dpf-core

- name: "Deploy to gh-pages"
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: HTML-doc-ansys-dpf-core/
token: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
branch: gh-pages
git-config-name: pyansys-ci-bot
git-config-email: pyansys.github.bot@ansys.com
repository-name: pyansys/DPF-Core-docs
commit-message: Documentation generated for ${{ steps.get_version.outputs.VERSION }}
clean-exclude: "CNAME"
tag: doc-${{ steps.get_version.outputs.VERSION }}
jobs:

Publish_to_PyPI:
name: Publish to PyPI
Expand All @@ -57,4 +25,17 @@ jobs:
twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

upload_docs_release:
name: "Upload stable documentation"
needs: [Publish_to_PyPI]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: "Deploy the stable documentation"
uses: pyansys/actions/doc-deploy-stable@v2
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

0 comments on commit 9843ab0

Please sign in to comment.