File tree Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -2,40 +2,21 @@ name: Containerise and Upload to DAFNI
2
2
3
3
on :
4
4
workflow_dispatch :
5
- workflow_run :
6
- workflows : ["publish-to-pypi"]
7
- branches : main
8
- types : [completed]
5
+ release :
6
+ types : [published]
9
7
10
- jobs :
11
-
12
- check_publish_to_pypi :
13
- name : Check Publish to PyPI
14
- runs-on : ubuntu-latest
15
-
16
- steps :
17
- - name : Check if Publish to PyPI succeeded
18
- id : check_publish
19
- run : |
20
- if [ "${{ github.event.workflow_run.conclusion }}" = "success" ]; then
21
- echo "The Causal Testing Framework has been published to PyPI"
22
- latest_tag=$(git describe --tags --abbrev=0)
23
- echo "Latest tag: $latest_tag"
24
- echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
25
- else
26
- echo "The Causal Testing Framework has not been published to PyPI"
27
- fi
28
-
29
8
9
+ jobs :
30
10
31
11
build_and_upload :
32
12
name : Docker Build
33
- if : ${{ github.event_name == 'workflow_dispatch ' || needs.check_publish_to_pypi.outputs.check_publish == 'success ' }}
13
+ if : ${{ github.event_name == 'release ' || github.event_name == 'workflow_dispatch ' }}
34
14
runs-on : ubuntu-latest
35
15
env :
36
16
DAFNI_PARENT_ID : ${{ secrets.DAFNI_PARENT_ID }}
37
17
DAFNI_USERNAME : ${{ secrets.DAFNI_USERNAME }}
38
18
DAFNI_PASSWORD : ${{ secrets.DAFNI_PASSWORD }}
19
+ CTF_VERSION : ${{ github.event.release.tag_name }}
39
20
40
21
steps :
41
22
- uses : actions/checkout@v3
54
35
55
36
- name : Upload to DAFNI
56
37
run : |
57
- dafni upload model ./dafni/model_definition.yaml ctf-gh.tar.gz --version-message "Version {{ env.LATEST_TAG }}. Uploaded via Github." --parent-id ${DAFNI_PARENT_ID} -y
38
+ dafni upload model ./dafni/model_definition.yaml ctf-gh.tar.gz --version-message "Version $ {{ env.CTF_VERSION }}. Uploaded via Github." --parent-id ${DAFNI_PARENT_ID} -y
58
39
dafni logout
You can’t perform that action at this time.
0 commit comments