File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Containerise and Upload to DAFNI
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ workflow_run :
6
+ workflows : ["publish-to-pypi"]
7
+ branches : main
8
+ types : [completed]
9
+
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
+ else
23
+ echo "The Causal Testing Framework has not been published to PyPI"
24
+ fi
25
+
26
+
27
+ build_and_upload :
28
+ name : Docker Build
29
+ if : ${{ github.event_name == 'workflow_dispatch' || needs.check_publish_to_pypi.outputs.check_publish == 'success' }}
30
+ runs-on : ubuntu-latest
31
+ env :
32
+ DAFNI_PARENT_ID : ${{ secrets.DAFNI_PARENT_ID }}
33
+ DAFNI_USERNAME : ${{ secrets.DAFNI_USERNAME }}
34
+ DAFNI_PASSWORD : ${{ secrets.DAFNI_PASSWORD }}
35
+ CTF_VERSION : " ${{ github.event.release.tag_name | replace('.', '') }}"
36
+
37
+ steps :
38
+ - uses : actions/checkout@v3
39
+ - uses : actions/setup-python@v3
40
+ with :
41
+ python-version : 3.9
42
+ - name : Build the container
43
+ run : |
44
+ docker build -t ctf:${CTF_VERSION} -f ./dafni/Dockerfile .
45
+ docker save ctf:${CTF_VERSION} | gzip > ctf${CTF_VERSION}.tar.gz
46
+
47
+ - name : Install DAFNI-CLI and log in
48
+ run : |
49
+ python -m pip install dafni-cli
50
+ dafni login
51
+
52
+ - name : Upload to DAFNI
53
+ run : |
54
+ dafni upload model ./dafni/model_definition.yaml ctf${CTF_VERSION}.tar.gz --version-message "Version ${CTF_VERSION}. Uploaded via Github." --parent-id ${DAFNI_PARENT_ID} -y
55
+ dafni logout
You can’t perform that action at this time.
0 commit comments