added retries
This commit is contained in:
28
.github/workflows/build.yml
vendored
28
.github/workflows/build.yml
vendored
@@ -150,13 +150,33 @@ jobs:
|
||||
ls -la windows-bin/
|
||||
|
||||
- name: Build Linux Docker image
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
BUILDKIT_PROGRESS: plain
|
||||
run: |
|
||||
for attempt in {1..3}; do
|
||||
if docker buildx build \
|
||||
--platform linux/amd64 \
|
||||
-f Dockerfile.linux \
|
||||
--build-arg BINARY_NAME=${{ needs.detect-project.outputs.project-name }} \
|
||||
-t ${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} \
|
||||
--output=type=docker .; then
|
||||
break
|
||||
fi
|
||||
echo "Attempt $attempt failed, retrying in 5 seconds..."
|
||||
sleep 5
|
||||
docker system prune -af
|
||||
done
|
||||
|
||||
- name: Login to Docker registry
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
echo "Building Linux Docker-Image with env-Tag: ${{env.TAG }}"
|
||||
docker build -f Dockerfile.linux \
|
||||
--build-arg BINARY_NAME=${{ needs.detect-project.outputs.project-name }} \
|
||||
-t ${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} .
|
||||
echo "Logging in to Docker registry: ${{ env.REGISTRY }}"
|
||||
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login git.triggermeelmo.com -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
|
||||
- name: Tag and Push Linux Docker image
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
echo "Tagging Linux Docker image"
|
||||
docker tag ${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }}
|
||||
echo "Pushing Linux Docker image to registry: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }}"
|
||||
|
Reference in New Issue
Block a user