File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,17 @@ jobs:
103
103
restore-keys : |
104
104
${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx-
105
105
106
+ - name : Check for Push Credentials
107
+ id : authorized
108
+ run : |
109
+ if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]; then
110
+ echo "::set-output name=PUSH::true"
111
+ else
112
+ echo "::set-output name=PUSH::false"
113
+ fi
114
+
106
115
- name : Login to DockerHub
116
+ if : steps.authorized.outputs.PUSH
107
117
uses : docker/login-action@v1
108
118
with :
109
119
username : ${{ secrets.DOCKERHUB_USERNAME }}
@@ -124,7 +134,7 @@ jobs:
124
134
uses : docker/build-push-action@v2
125
135
with :
126
136
context : packaging/docker-image
127
- push : true
137
+ push : ${{ steps.authorized.outputs.PUSH }}
128
138
tags : |
129
139
pivotalrabbitmq/rabbitmq:${{ steps.compute-tags.outputs.TAG_1 }}
130
140
pivotalrabbitmq/rabbitmq:${{ steps.compute-tags.outputs.TAG_2 }}
You can’t perform that action at this time.
0 commit comments