Skip to content

Commit 05558d4

Browse files
committed
Add restrictions by setting conditions on docker builds
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent dbb10c0 commit 05558d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- docker push "$DOCKER_TAG_COMMIT"
5858

5959
- stage: Tag docker image with branch name
60-
if: branch IS present
60+
if: type = push AND branch IS present
6161
script:
6262
- set -e
6363
- docker pull "$DOCKER_TAG_COMMIT"
@@ -75,7 +75,7 @@ jobs:
7575
- docker push "$DOCKER_TAG_PR_NUM"
7676

7777
- stage: Tag docker image with git-tag
78-
if: tag IS present
78+
if: type = push AND tag IS present
7979
script:
8080
- set -e
8181
- docker pull "$DOCKER_TAG_COMMIT"
@@ -84,7 +84,7 @@ jobs:
8484
- docker push "$DOCKER_TAG_GITTAG"
8585

8686
- stage: Tag docker image as latest
87-
if: branch = master
87+
if: type = push AND branch = master
8888
script:
8989
- set -e
9090
- docker pull "$DOCKER_TAG_COMMIT"
@@ -93,7 +93,7 @@ jobs:
9393
- docker push "$DOCKER_TAG_LATEST"
9494

9595
- stage: Deploy new release on GitHub
96-
if: tag IS present
96+
if: type = push AND branch = master AND tag IS present
9797
script: skip
9898
deploy:
9999
- provider: releases
@@ -104,7 +104,7 @@ jobs:
104104
tags: true
105105

106106
- stage: Deploy new release on PyPI
107-
if: tag IS present
107+
if: type = push AND branch = master AND tag IS present
108108
script: skip
109109
deploy:
110110
- provider: pypi

0 commit comments

Comments
 (0)