From 24b5404e6d91b12e2bfca4c38fe89d149f409f3a Mon Sep 17 00:00:00 2001 From: Brandon Berhent Date: Thu, 27 Jun 2024 08:15:08 -0400 Subject: [PATCH] Use buildx --- .github/workflows/ci.yml | 15 ++++++++------- server/Dockerfile | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3908aca..a21a732 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,7 @@ jobs: GITHUB_RUN_ID: ${{ github.run_id }} steps: - uses: actions/checkout@master + - name: Login to registry uses: actions-hub/docker/login@master env: @@ -83,15 +84,15 @@ jobs: shell: bash run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV - - name: Build and tag + - name: Build and push if: success() - run: docker build -t appditto/natricon-server:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }} server - - - name: Push image - if: success() - uses: actions-hub/docker@master + uses: docker/build-push-action@v3 with: - args: push appditto/natricon-server:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }} + context: server + platforms: linux/amd64 + push: true + file: ./Dockerfile + tags: appditto/natricon-server:${{ env.BRANCH_NAME }}-${{ env.GITHUB_RUN_ID }} deploy_nuxt: name: Deploy nuxt app diff --git a/server/Dockerfile b/server/Dockerfile index 8b3c4f4..bb82800 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,5 +1,7 @@ FROM appditto/libvips:latest as builder +ARG TARGETARCH + WORKDIR /root # Update GO