From 73c5b1573a3d4975d34207797ac70942da0b2f32 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Fri, 23 Feb 2024 11:09:43 +0000 Subject: [PATCH] fix outdated docker build --- .github/workflows/docker-image.yml | 53 +++++++++--------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b12c32b..6179aef 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -9,58 +9,37 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: crazy-max/ghaction-docker-buildx@v3 + uses: docker/setup-buildx-action@v3 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - - - name: Docker Buildx (build amd64 arm64) - run: | - docker buildx build \ - --cache-from "type=local,src=/tmp/.buildx-cache" \ - --cache-to "type=local,dest=/tmp/.buildx-cache" \ - --platform linux/amd64 \ - --output "type=image,push=false" \ - --tag albertoxamin/bang:latest \ - --file ./Dockerfile ./ - - - name: Docker Buildx (build armv-7) - run: | - docker buildx build \ - --cache-from "type=local,src=/tmp/.buildx-cache" \ - --cache-to "type=local,dest=/tmp/.buildx-cache" \ - --platform linux/arm/v7 \ - --output "type=image,push=false" \ - --tag albertoxamin/bang:latest \ - --file ./Dockerfile ./ - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Docker Buildx (push all) - run: | - docker buildx build \ - --cache-from "type=local,src=/tmp/.buildx-cache" \ - --platform linux/amd64,linux/arm/v7 \ - --output "type=image,push=true" \ - --tag albertoxamin/bang:latest \ - --file ./Dockerfile ./ - - - name: Inspect image - run: | - docker buildx imagetools inspect albertoxamin/bang:latest + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm/v7,linux/amd64 + push: true + tags: albertoxamin/bang:latest + cache-from: type=registry,ref=user/app:latest + cache-to: type=inline - name: Notify discord uses: th0th/notify-discord@v0.4.1