diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index f8bd481..9a2b020 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -41,19 +41,36 @@ jobs: id: build_toonflow run: | set -o pipefail + BUILD_OK=0 for attempt in 1 2 3; do echo "Build ToonFlow attempt $attempt/3..." - DOCKER_BUILDKIT=0 docker build \ + if DOCKER_BUILDKIT=0 docker build \ --tag ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} \ --tag ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest \ - . 2>&1 | tee /tmp/build.log && break + . 2>&1 | tee /tmp/build.log; then + BUILD_OK=1 + break + fi echo "Attempt $attempt failed, retrying in 10s..." && sleep 10 done + if [ "$BUILD_OK" -ne 1 ]; then + echo "Docker build failed after 3 attempts." + exit 1 + fi + + PUSH_OK=0 for attempt in 1 2 3; do - docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} && \ - docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest && break + if docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} && \ + docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest; then + PUSH_OK=1 + break + fi echo "Push attempt $attempt failed, retrying in 10s..." && sleep 10 done + if [ "$PUSH_OK" -ne 1 ]; then + echo "Docker push failed after 3 attempts." + exit 1 + fi - name: Setup Kubectl run: | diff --git a/Dockerfile b/Dockerfile index 93205b4..2d8f39b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ FROM node:24-bookworm-slim WORKDIR /app RUN sed -i \ - -e 's|http://deb.debian.org/debian|https://mirrors.aliyun.com/debian|g' \ - -e 's|http://deb.debian.org/debian-security|https://mirrors.aliyun.com/debian-security|g' \ + -e 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' \ + -e 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' \ /etc/apt/sources.list.d/debian.sources && \ apt-get update && \ apt-get install -y --no-install-recommends ca-certificates python3 make g++ && \