From 60f6061ba84fae60c2314b3de65541c8ca45ae24 Mon Sep 17 00:00:00 2001 From: Kokomo123 Date: Thu, 22 Aug 2024 16:57:16 -0400 Subject: [PATCH] Add arm64 building potentially. --- .github/workflows/main.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aad7bfa7..f05877ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,20 +55,26 @@ jobs: echo "IMAGE_ID=$(echo ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV # region See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio - - name: Build Image - run: | - docker build -t $IMAGE_NAME . + - name: Use QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master - name: Log In to Registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + run: echo "${{ secrets.TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Push Image - run: | - echo IMAGE_ID=$IMAGE_ID - echo IMAGE_VERSION=$IMAGE_VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$IMAGE_VERSION - # Always tag latest when pushing a tag, as we don't expect to ever merge old tags - [[ "${{ github.ref }}" == "refs/tags/"* ]] && docker tag $IMAGE_NAME $IMAGE_ID:latest - docker push $IMAGE_ID:$IMAGE_VERSION - docker push $IMAGE_ID:latest + - name: Build and push the docker image + uses: docker/build-push-action@master + with: + context: . + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/arm64,linux/amd64 + push: true + tags: ghcr.io/kokomo/5etools-img:latest + #labels: ${{ steps.meta.outputs.labels }} + # endregion