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:
-
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