-
Notifications
You must be signed in to change notification settings - Fork 25
55 lines (49 loc) · 1.48 KB
/
ansys_lab.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Ansys Lab
on:
# Can be called by the CI
workflow_call:
inputs:
version:
description: "Release version as 'X.Y.Z'"
type: string
required: true
# Can be called manually
workflow_dispatch:
inputs:
version:
description: "Release version as 'X.Y.Z'"
type: string
required: true
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: tags/${{ 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: "Push changes"
shell: bash
run: |
git add .
git status
git commit -m ${{ inputs.version }}
git push
git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }}
git push origin ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }}