File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -145,12 +145,31 @@ jobs:
145
145
username : ${{ secrets.DOCKERHUB_USERNAME }}
146
146
password : ${{ secrets.DOCKERHUB_TOKEN }}
147
147
148
+ - name : Set Docker tags
149
+ id : docker_tags
150
+ run : |
151
+ if [[ ${{ github.event.release.tag_name }} == "preview" ]]; then
152
+ echo "::set-output name=preview::true"
153
+ else
154
+ echo "::set-output name=preview::false"
155
+ fi
156
+
148
157
- name : Build and push Docker image
149
158
uses : docker/build-push-action@v4
150
159
with :
151
160
context : .
152
161
file : ./Dockerfile
153
162
push : true
154
163
tags : |
155
- ${{ env.DOCKER_IMAGE_NAME }}:latest
156
164
${{ env.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}
165
+ ${{ env.DOCKER_IMAGE_NAME }}:latest
166
+ if : steps.docker_tags.outputs.preview == 'false'
167
+
168
+ - name : Build and push Docker image without latest tag (preview release)
169
+ uses : docker/build-push-action@v4
170
+ with :
171
+ context : .
172
+ file : ./Dockerfile
173
+ push : true
174
+ tags : ${{ env.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}
175
+ if : steps.docker_tags.outputs.preview == 'true'
You can’t perform that action at this time.
0 commit comments