From ad19fddbbde84a4b4e997b288a055871a40b057c Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Wed, 15 Jun 2022 10:21:37 +0530 Subject: [PATCH] Add CI matrix for image tag --- .ci/pull_fluent_image.py | 5 ++++- .github/workflows/ci_cd.yml | 14 ++++++++++---- .github/workflows/nightly-doc-build.yml | 7 +++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.ci/pull_fluent_image.py b/.ci/pull_fluent_image.py index 05f0f4d3..3fc1d1fa 100644 --- a/.ci/pull_fluent_image.py +++ b/.ci/pull_fluent_image.py @@ -1,6 +1,9 @@ +import os + import docker -_IMAGE_NAME = "ghcr.io/pyansys/pyfluent:latest" +_IMAGE_TAG = os.getenv("FLUENT_IMAGE_TAG", "latest") +_IMAGE_NAME = f"ghcr.io/pyansys/pyfluent:{_IMAGE_TAG}" def _is_newer_version_available(client: docker.DockerClient): diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 418ab6e1..ed09e333 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -68,6 +68,9 @@ jobs: docs: name: Documentation runs-on: self-hosted + strategy: + matrix: + image-tag: [latest] steps: - uses: actions/checkout@v3 @@ -102,6 +105,8 @@ jobs: - name: Pull Fluent docker image run: make docker-pull + env: + FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} - name: Retrieve pyfluent-visualization version run: | @@ -113,9 +118,9 @@ jobs: uses: actions/cache@v3 with: path: doc/source/examples - key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYFLUENT_VISUALIZATION_VERSION }}-${{ hashFiles('examples/**') }}-${{ github.sha }} + key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYFLUENT_VISUALIZATION_VERSION }}-${{ matrix.image-tag }}-${{ hashFiles('examples/**') }}-${{ github.sha }} restore-keys: | - Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYFLUENT_VISUALIZATION_VERSION }}-${{ hashFiles('examples/**') }} + Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYFLUENT_VISUALIZATION_VERSION }}-${{ matrix.image-tag }}-${{ hashFiles('examples/**') }} - name: Generate the documentation run: make build-doc @@ -123,16 +128,17 @@ jobs: ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} PYFLUENT_START_INSTANCE: 0 DOCS_CNAME: fluentvisualization.docs.pyansys.com + FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} - name: Upload HTML Documentation uses: actions/upload-artifact@v3 with: - name: HTML-Documentation + name: HTML-Documentation-tag-${{ matrix.image-tag }} path: doc/_build/html retention-days: 7 - name: Deploy - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') && ${{ matrix.image-tag == 'latest'}} uses: JamesIves/github-pages-deploy-action@4.1.4 with: repository-name: pyansys/pyfluent-visualization-docs diff --git a/.github/workflows/nightly-doc-build.yml b/.github/workflows/nightly-doc-build.yml index 5a3d8523..f988a811 100644 --- a/.github/workflows/nightly-doc-build.yml +++ b/.github/workflows/nightly-doc-build.yml @@ -8,6 +8,9 @@ on: jobs: nightly_docs_build: runs-on: ubuntu-20.04 + strategy: + matrix: + image-tag: [latest] steps: - uses: actions/checkout@v3 @@ -42,6 +45,8 @@ jobs: - name: Pull Fluent docker image run: make docker-pull + env: + FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} - name: Generate the documentation run: make build-doc @@ -49,8 +54,10 @@ jobs: 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: Deploy + if: ${{ matrix.image-tag == 'latest'}} uses: JamesIves/github-pages-deploy-action@4.1.4 with: repository-name: pyansys/pyfluent-visualization-dev-docs