From a17ca1b90c0ffff7a6119a763132e7800b3fdd63 Mon Sep 17 00:00:00 2001 From: nurdotnet <278048682+nurdotnet@users.noreply.github.com> Date: Thu, 23 Apr 2026 00:06:29 +0500 Subject: [PATCH] ci(docker): drop docker/login-action and build-push-action These actions' tarballs are downloaded from api.github.com, and downloads from our runner's network intermittently time out past the 100s HttpClient limit. The job then fails after 3 retries. Replace them with plain docker CLI commands: system docker already has buildx (via apt) and can login + push to ghcr.io directly. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/docker.yml | 58 ++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a9f53f7..924ab03 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,23 +25,20 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to ghcr + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + ACTOR: ${{ github.actor }} + run: echo "$TOKEN" | docker login ghcr.io -u "$ACTOR" --password-stdin - - name: Build + push - uses: docker/build-push-action@v6 - with: - context: . - file: deploy/Dockerfile.api - push: true - tags: | - ghcr.io/${{ github.repository_owner }}/food-market-api:latest - ghcr.io/${{ github.repository_owner }}/food-market-api:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + - name: Build + push api + env: + OWNER: ${{ github.repository_owner }} + SHA: ${{ github.sha }} + run: | + docker build -f deploy/Dockerfile.api -t ghcr.io/$OWNER/food-market-api:$SHA -t ghcr.io/$OWNER/food-market-api:latest . + docker push ghcr.io/$OWNER/food-market-api:$SHA + docker push ghcr.io/$OWNER/food-market-api:latest web: name: Web image @@ -49,20 +46,17 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to ghcr + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + ACTOR: ${{ github.actor }} + run: echo "$TOKEN" | docker login ghcr.io -u "$ACTOR" --password-stdin - - name: Build + push - uses: docker/build-push-action@v6 - with: - context: . - file: deploy/Dockerfile.web - push: true - tags: | - ghcr.io/${{ github.repository_owner }}/food-market-web:latest - ghcr.io/${{ github.repository_owner }}/food-market-web:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + - name: Build + push web + env: + OWNER: ${{ github.repository_owner }} + SHA: ${{ github.sha }} + run: | + docker build -f deploy/Dockerfile.web -t ghcr.io/$OWNER/food-market-web:$SHA -t ghcr.io/$OWNER/food-market-web:latest . + docker push ghcr.io/$OWNER/food-market-web:$SHA + docker push ghcr.io/$OWNER/food-market-web:latest