From eb4dd1abea246f4674c5f2ede694ff82da1ec956 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:50:03 +0100 Subject: [PATCH] Add ansys_lab.yml (#1287) --- .github/workflows/ansys_lab.yml | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/ansys_lab.yml diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml new file mode 100644 index 0000000000..c56a2af496 --- /dev/null +++ b/.github/workflows/ansys_lab.yml @@ -0,0 +1,52 @@ +name: Ansys Lab + +on: +# Can be called by the CI + workflow_call: + inputs: + version: + description: "Release tag as 'tags/XX' (defaults to latest)" + type: string + required: false + default: latest +# Can be called manually + workflow_dispatch: + inputs: + version: + description: "Release tag as 'tags/XX' (defaults to latest)" + type: string + required: false + default: latest + +env: + DESTINATION_BRANCH_NAME: ansys_lab_examples + +jobs: + deploy_examples: + name: "Deploy examples for Ansys Lab" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: env.DESTINATION_BRANCH_NAME + + - name: "Download Release Asset - HTML" + uses: dsaltares/fetch-gh-release-asset@1.1.0 + with: + file: HTML-doc-ansys-dpf-core.zip + token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ inputs.version }} + + - name: "Extract ipynb examples" + shell: python + run: | + import os + import zipfile + with zipfile.ZipFile("HTML-doc-ansys-dpf-core.zip", 'r') as z: + [z.extract(file, "./") for file in z.namelist() if file.endswith(".ipynb")] + os.remove("HTML-doc-ansys-dpf-core.zip") + + - name: "Show changes" + shell: bash + run: | + git status \ No newline at end of file