diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 7a12554..fbdd82f 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -26,42 +26,61 @@ jobs: - name: Log in to registry run: echo "${{ secrets.CI_TOKEN }}" | docker login gitea.gitea.svc.cluster.local:3000 -u chemavx --password-stdin + - name: Create buildx builder + run: | + cat > /tmp/buildkitd.toml << 'EOF' + [registry."registry-cache.registry-cache.svc.cluster.local:5000"] + http = true + insecure = true + + [registry."gitea.gitea.svc.cluster.local:3000"] + http = true + insecure = true + + [registry."docker.io"] + mirrors = ["registry-cache.registry-cache.svc.cluster.local:5000"] + EOF + docker buildx create \ + --name ci-builder \ + --driver docker-container \ + --driver-opt network=host \ + --config /tmp/buildkitd.toml \ + --use + docker buildx inspect --bootstrap + - name: Build and push bot image run: | TAG=${{ steps.tag.outputs.TAG }} - docker build \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --cache-from gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:buildcache \ + docker buildx build \ + --builder ci-builder \ + --cache-from type=registry,ref=gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:buildcache \ + --cache-to type=registry,ref=gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:buildcache,mode=max \ -t gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:${TAG} \ - -t gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:buildcache \ + --push \ -f Dockerfile . - docker push gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:${TAG} - docker push gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot:buildcache - name: Build and push API image run: | TAG=${{ steps.tag.outputs.TAG }} - docker build \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --cache-from gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:buildcache \ + docker buildx build \ + --builder ci-builder \ + --cache-from type=registry,ref=gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:buildcache \ + --cache-to type=registry,ref=gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:buildcache,mode=max \ -t gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:${TAG} \ - -t gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:buildcache \ + --push \ -f Dockerfile.api . - docker push gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:${TAG} - docker push gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-api:buildcache - name: Build and push dashboard image run: | TAG=${{ steps.tag.outputs.TAG }} - docker build \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --cache-from gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:buildcache \ + docker buildx build \ + --builder ci-builder \ + --cache-from type=registry,ref=gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:buildcache \ + --cache-to type=registry,ref=gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:buildcache,mode=max \ -t gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:${TAG} \ - -t gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:buildcache \ + --push \ -f dashboard/Dockerfile \ dashboard - docker push gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:${TAG} - docker push gitea.gitea.svc.cluster.local:3000/chemavx/polymarket-bot-dashboard:buildcache - name: Update k8s manifests run: |