We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d34347 commit 70e8e76Copy full SHA for 70e8e76
user/docker.md
@@ -137,6 +137,20 @@ Within your `.travis.yml` prior to attempting a `docker push` or perhaps before
137
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
138
```
139
140
+#### Branch Based Registry Pushes
141
+
142
+Using `after_success` it is also possible to push an image to a registry based
143
+on the branch:
144
145
+```yaml
146
147
+ after_success:
148
+ - if [ "$TRAVIS_BRANCH" == "master" ]; then
149
+ docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
150
+ docker push USER/REPO;
151
+ fi
152
+```
153
154
#### Private Registry Login
155
156
When pushing to a private registry, be sure to specify the hostname in the
0 commit comments