-
Notifications
You must be signed in to change notification settings - Fork 136
82 lines (79 loc) · 2.87 KB
/
update_manifest_dl4miceverywhere.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Update the manifest with DL4MicEverywhere information
on:
# At 05:30 AM of every day
schedule:
- cron: "30 5 * * *"
workflow_dispatch:
jobs:
update_manifest:
name: Update the manifest.bioimage.io.yaml with DL4MicEverywhere information
outputs:
matrix: ${{ steps.create_json.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- name: Clone ZeroCostDL4Mic repository
uses: actions/checkout@v4
with:
path: ZeroCostDL4Mic
- name: Clone DL4MicEverywhere repository
uses: actions/checkout@v4
with:
repository: HenriquesLab/DL4MicEverywhere
path: DL4MicEverywhere
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install requirements
working-directory: ./ZeroCostDL4Mic
run: pip install -r Tools/CI_requirements.txt
- name: Update the versioning on the manifest
working-directory: ./ZeroCostDL4Mic
run: python3 Tools/update_manifest_versioning.py
- name: Update the DL4MicEverywhere information on the manifest
working-directory: ./ZeroCostDL4Mic
id: updated_notebooks
run: |
output=$(python3 Tools/update_manifest_dl4miceverywhere.py)
echo "$output"
echo "value=$output" >> $GITHUB_OUTPUT
- if: ${{ steps.updated_notebooks.outputs.value != '' }}
name: List and extract all notebook with new version
id: create_json
run: |
echo "Start"
files_json="{\"include\":[{\"notebook\":\""
echo "$files_json"
first=true
for file in ${{ steps.updated_notebooks.outputs.value }}; do
echo "$file was changed"
if [ "$first" = true ]; then
files_json+=$file
first=false
else
files_json+="\"},{\"notebook\":\""$file
fi
echo "$files_json"
done
files_json+="\"}]}"
echo "$files_json"
echo "matrix=$files_json" >> $GITHUB_OUTPUT
echo "END"
- name: Commit the changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./ZeroCostDL4Mic
commit_message: GitHub Action - Update manifest with DL4MicEverywhere information
config_matrix:
if: ${{ needs.update_manifest.outputs.matrix != '' }}
name: Call the building and pushing, and possible update configuration
needs: update_manifest
strategy:
# put fail-fast as false if you want to see all results even if one fails,
# fail-fast is true by default
fail-fast: false
matrix: ${{ fromJson(needs.update_manifest.outputs.matrix) }}
uses: ./.github/workflows/export_notebook.yml # calls the one above ^
with:
notebook_name: ${{ matrix.notebook }}
secrets: inherit