Skip to content

Commit abf18dd

Browse files
authored
Merge pull request #517 from cmu-delphi/sgratzl/ci_fix
ci: require build to be successful before creating image
2 parents 7de6a7d + 38542ea commit abf18dd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ jobs:
8585
docker network remove delphi-net
8686
8787
image:
88+
needs: build
8889
# only on main and dev branch
89-
if: startsWith(github.ref, 'refs/heads/main') || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/sgratzl/flaskx'
90+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
9091
runs-on: ubuntu-latest
9192
steps:
9293
- name: Check out code
@@ -107,14 +108,9 @@ jobs:
107108
run: |
108109
baseRef="${GITHUB_REF#*/}"
109110
imageTag="${baseRef#*/}"
110-
case "${baseRef}" in
111-
main)
111+
if [ "$imageTag" = "main" ] ; then
112112
imageTag="latest"
113-
;;
114-
*)
115-
imageTag="${baseRef//\//_}" # replace `/` with `_` in branch name
116-
;;
117-
esac
113+
fi
118114
echo "::set-output name=tag::$imageTag"
119115
echo "::set-output name=repo::ghcr.io/${{ github.repository }}"
120116
- name: Push Dev Tag

0 commit comments

Comments
 (0)