Skip to content

Commit be39496

Browse files
authored
OPSEXP-3750 Automatic retry for docker.io push (#303)
1 parent 658b70f commit be39496

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@ jobs:
112112
username: ${{ secrets.QUAY_USERNAME }}
113113
password: ${{ secrets.QUAY_PASSWORD }}
114114

115-
- name: Login to docker.io
116-
if: github.ref_name == 'master'
117-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
118-
with:
119-
username: ${{ secrets.DOCKER_USERNAME }}
120-
password: ${{ secrets.DOCKER_PASSWORD }}
121-
122115
- name: Build image for tests
123116
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
124117
with:
@@ -207,12 +200,25 @@ jobs:
207200
run: |
208201
docker buildx imagetools create ${{ env.SRC_IMAGE }} -t ${{ env.DST_IMAGE }}
209202
203+
204+
- name: Login to docker.io
205+
if: github.ref_name == 'master'
206+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
207+
with:
208+
username: ${{ secrets.DOCKER_USERNAME }}
209+
password: ${{ secrets.DOCKER_PASSWORD }}
210+
210211
- name: Push images to docker.io
211212
if: github.ref_name == 'master'
213+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
212214
env:
213215
SRC_IMAGE: quay.io/${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}
214216
DST_IMAGE: ${{ env.IMAGE_REGISTRY_NAMESPACE }}/${{ env.IMAGE_REPOSITORY }}:${{ steps.vars.outputs.image_tag }}
215-
run: >-
216-
docker buildx imagetools create ${{ env.SRC_IMAGE }}
217-
-t ${{ env.DST_IMAGE }}
218-
-t ${{ env.DST_IMAGE }}-${{ steps.vars.outputs.timestamp }}
217+
with:
218+
timeout_minutes: 10
219+
max_attempts: 3
220+
retry_wait_seconds: 30
221+
command: >-
222+
docker buildx imagetools create ${{ env.SRC_IMAGE }}
223+
-t ${{ env.DST_IMAGE }}
224+
-t ${{ env.DST_IMAGE }}-${{ steps.vars.outputs.timestamp }}

0 commit comments

Comments
 (0)