Skip to content

Commit

Permalink
Add ansys_lab.yml (#1287)
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Nov 21, 2023
1 parent ac3cd67 commit eb4dd1a
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ansys_lab.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit eb4dd1a

Please sign in to comment.