From 379371d440b68abae759cc8e4751309e97b0cba6 Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 4 May 2023 15:06:09 +0200 Subject: [PATCH] Sets up separate docker build for arm --- .github/workflows/docker.yml | 67 +++++------------------------------- 1 file changed, 9 insertions(+), 58 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ecfdf372..950fcbf8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,7 +14,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Docker meta id: meta uses: docker/metadata-action@v4 @@ -23,54 +22,37 @@ jobs: tags: | type=semver,pattern={{version}} type=sha - - name: Login to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and export to Docker - id: build + - name: Build and push uses: docker/build-push-action@v4 with: context: . file: docker/codex.Dockerfile platforms: linux/amd64 - load: true + push: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: Minify docker image uses: kitabisa/docker-slim-action@v1 env: DSLIM_HTTP_PROBE: false with: - target: ${{ steps.meta.outputs.tags }} - overwrite: true - - - name: Show slim report - run: echo "${{ steps.slim.outputs.report }}" - - - name: Push to Docker registry + target: ${{ steps.meta.outputs.labels }} + tag: ${{ steps.meta.outputs.tags }} + - name: Push image to docker registry + run: docker image push "${{ steps.meta.outputs.labels }}:${{ steps.meta.outputs.tags }}" if: github.event_name != 'pull_request' - id: push - uses: docker/build-push-action@v4 - with: - context: . - file: docker/codex.Dockerfile - platforms: linux/amd64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} docker-arm64: - runs-on: buildjet-4vcpu-ubuntu-2204-arm + runs-on: buildjet-2vcpu-ubuntu-2204-arm steps: - name: Checkout uses: actions/checkout@v3 - - name: Docker meta id: meta uses: docker/metadata-action@v4 @@ -79,51 +61,21 @@ jobs: tags: | type=semver,pattern={{version}} type=sha - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and export to Docker - id: build + - name: Build and push uses: docker/build-push-action@v4 with: context: . file: docker/codex.Dockerfile platforms: linux/arm64 - load: true + push: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - - name: Minify docker image - uses: kitabisa/docker-slim-action@v1 - env: - DSLIM_HTTP_PROBE: false - with: - target: ${{ steps.meta.outputs.tags }} - overwrite: true - - - name: Show slim report - run: echo "${{ steps.slim.outputs.report }}" - - - name: Push to Docker registry - if: github.event_name != 'pull_request' - id: push - uses: docker/build-push-action@v4 - with: - context: . - file: docker/codex.Dockerfile - platforms: linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - # Slim it! - name: Minify docker image uses: kitabisa/docker-slim-action@v1 env: @@ -131,7 +83,6 @@ jobs: with: target: ${{ steps.meta.outputs.labels }} tag: ${{ steps.meta.outputs.tags }} - # Push to the docker registry - name: Push image to docker registry run: docker image push "${{ steps.meta.outputs.labels }}:${{ steps.meta.outputs.tags }}" if: github.event_name != 'pull_request'