Also build an arm64 image

This commit is contained in:
Gervasio Marchand 2022-12-18 11:18:09 -03:00
parent a2d351161c
commit 20befd3d9e
No known key found for this signature in database
GPG Key ID: B7736CB188DD0A38
2 changed files with 20 additions and 5 deletions

View File

@ -6,6 +6,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [ amd64, arm64v8 ]
steps:
- name: Checkout
uses: actions/checkout@v3
@ -25,6 +28,17 @@ jobs:
Write-Host "Version $version"
Pop-Location
docker build . --tag ghcr.io/g3rv4/fakerelay:latest --tag "ghcr.io/g3rv4/fakerelay:$version"
docker push ghcr.io/g3rv4/fakerelay:latest
docker push "ghcr.io/g3rv4/fakerelay:$version"
if ('${{ matrix.architecture }}' -eq 'arm64v8') {
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
}
docker build . -t ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }} --build-arg ARCH=${{ matrix.architecture }}
docker tag ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }} ghcr.io/g3rv4/fakerelay:$version-${{ matrix.architecture }}
docker push ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }}
docker push ghcr.io/g3rv4/fakerelay:$version-${{ matrix.architecture }}
if ('${{ matrix.architecture }}' -eq 'amd64') {
docker tag ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }} ghcr.io/g3rv4/fakerelay:latest
docker push ghcr.io/g3rv4/fakerelay:latest
}

View File

@ -1,11 +1,12 @@
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:6.0.403-alpine3.16 AS builder
ARG ARCH=
FROM mcr.microsoft.com/dotnet/sdk:6.0.404-alpine3.16 AS builder
WORKDIR /src
COPY src /src/
RUN dotnet publish -c Release /src/FakeRelay.sln -o /app
FROM mcr.microsoft.com/dotnet/aspnet:6.0.11-alpine3.16
FROM mcr.microsoft.com/dotnet/aspnet:6.0.12-alpine3.16-${ARCH}
VOLUME ["/data"]
ENV CONFIG_PATH=/data/config.json
COPY --from=builder /app /app