fix outdated docker build

This commit is contained in:
Alberto Xamin 2024-02-23 11:09:43 +00:00
parent 4eb1a82ab7
commit 73c5b1573a
No known key found for this signature in database
GPG Key ID: 5ABFCD8A22EA6F5D

View File

@ -9,58 +9,37 @@ jobs:
steps: steps:
- -
name: Checkout 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 name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3 uses: docker/setup-buildx-action@v3
- -
name: Cache Docker layers name: Cache Docker layers
uses: actions/cache@v3 uses: actions/cache@v4
id: cache id: cache
with: with:
path: /tmp/.buildx-cache path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }} key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: | restore-keys: |
${{ runner.os }}-buildx- ${{ 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 name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Build and push
name: Docker Buildx (push all) uses: docker/build-push-action@v5
run: | with:
docker buildx build \ context: .
--cache-from "type=local,src=/tmp/.buildx-cache" \ platforms: linux/arm/v7,linux/amd64
--platform linux/amd64,linux/arm/v7 \ push: true
--output "type=image,push=true" \ tags: albertoxamin/bang:latest
--tag albertoxamin/bang:latest \ cache-from: type=registry,ref=user/app:latest
--file ./Dockerfile ./ cache-to: type=inline
-
name: Inspect image
run: |
docker buildx imagetools inspect albertoxamin/bang:latest
- name: Notify discord - name: Notify discord
uses: th0th/notify-discord@v0.4.1 uses: th0th/notify-discord@v0.4.1