Skip to content

Commit d52d41d

Browse files
committed
fix: clean up unnecessary code
1 parent a9bde4b commit d52d41d

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

.github/workflows/publish-to-dafni.yaml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,21 @@ name: Containerise and Upload to DAFNI
22

33
on:
44
workflow_dispatch:
5-
workflow_run:
6-
workflows: ["publish-to-pypi"]
7-
branches: main
8-
types: [completed]
5+
release:
6+
types: [published]
97

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-
298

9+
jobs:
3010

3111
build_and_upload:
3212
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' }}
3414
runs-on: ubuntu-latest
3515
env:
3616
DAFNI_PARENT_ID: ${{ secrets.DAFNI_PARENT_ID }}
3717
DAFNI_USERNAME: ${{ secrets.DAFNI_USERNAME }}
3818
DAFNI_PASSWORD: ${{ secrets.DAFNI_PASSWORD }}
19+
CTF_VERSION: ${{ github.event.release.tag_name }}
3920

4021
steps:
4122
- uses: actions/checkout@v3
@@ -54,5 +35,5 @@ jobs:
5435
5536
- name: Upload to DAFNI
5637
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
5839
dafni logout

0 commit comments

Comments
 (0)