Ansys Lab #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
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 |