From b8634dbc87f1181d6e1790be955656b2c349bc93 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Thu, 10 Jul 2025 18:45:25 -0700 Subject: [PATCH] update build scripts --- .gitea/workflows/build.yaml | 27 +++++++++++++-------------- Dockerfile | 8 ++++---- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index c8d0321..986f883 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -15,20 +15,19 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: build database + - name: build and push database run: | - docker buildx build --platform=linux/amd64,linux/arm64 -t mistox-sql ./database + docker buildx build \ + --platform=linux/amd64,linux/arm64 \ + -t docker.mistox.net/mistox-sql \ + --push \ + ./database - - name: build server + - name: build and push server run: | - docker buildx build --platform=linux/amd64,linux/arm64 --build-arg BASE_URL=https://mistox.com -t mistox-website . - - - name: publish database - run: | - docker image tag mistox-sql docker.mistox.net/mistox-sql && \ - docker push docker.mistox.net/mistox-sql - - - name: publish server - run: | - docker image tag mistox-website docker.mistox.net/mistox-website && \ - docker push docker.mistox.net/mistox-website \ No newline at end of file + docker buildx build \ + --platform=linux/amd64,linux/arm64 \ + --build-arg BASE_URL=https://mistox.com \ + -t docker.mistox.net/mistox-website \ + --push \ + . \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bd29bd3..91e6dab 100755 --- a/Dockerfile +++ b/Dockerfile @@ -40,15 +40,15 @@ RUN dotnet restore './MistoxWebsite.Server.csproj' COPY ./src/MistoxWebsite.Server/ ./ # Get the target arch -ARG TARGETOS TARGETARCH +ARG TARGETARCH # Build the source RUN set -e && \ - if [ "$TARGETARCH" = "arm64" ]; then RID="arm64"; \ - elif [ "$TARGETARCH" = "amd64" ]; then RID="x64"; \ + if [ "$TARGETARCH" = "arm64" ]; then RID="linux-arm64"; \ + elif [ "$TARGETARCH" = "amd64" ]; then RID="linux-x64"; \ else echo "Unsupported ARCH: $TARGETARCH"; exit 1; \ fi && \ - dotnet publish './MistoxWebsite.Server.csproj' -c Release -r linux-$RID -o /app/publish + dotnet publish './MistoxWebsite.Server.csproj' -c Release -r ${RID} -o /app/publish ################ ## Publish ##