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) <noreply@anthropic.com>
This commit is contained in:
parent
29cefb64be
commit
a17ca1b90c
58
.github/workflows/docker.yml
vendored
58
.github/workflows/docker.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue