From 4d84ca8926cb2220f6a4e4684adc065bbd3e4e78 Mon Sep 17 00:00:00 2001 From: David Thorpe Date: Mon, 8 Jan 2024 18:51:15 +0100 Subject: [PATCH] Updated to include amd64 --- .github/workflows/make-image.yaml | 42 ++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/make-image.yaml b/.github/workflows/make-image.yaml index 283ec34..d43d4d8 100644 --- a/.github/workflows/make-image.yaml +++ b/.github/workflows/make-image.yaml @@ -3,7 +3,7 @@ on: release: types: [ created, edited ] jobs: - build: + build-arm64: strategy: matrix: version: [ 2.311.0 ] @@ -17,7 +17,39 @@ jobs: run: | echo "arch=${{ matrix.arch }}" >> $GITHUB_OUTPUT echo "runner=${{ matrix.version }}" >> $GITHUB_OUTPUT - echo "image=ghcr.io/${{ github.repository_owner }}/runner-image-arm" >> $GITHUB_OUTPUT + echo "image=ghcr.io/${{ github.repository_owner }}/runner-image-${{ matrix.arch }}" >> $GITHUB_OUTPUT + echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + - name: Login + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build + run: | + docker build \ + --tag ${{ steps.tags.outputs.image }}:${{ steps.tags.outputs.tag }} \ + --build-arg RUNNER_VERSION=${{ steps.tags.outputs.runner }} \ + --build-arg RUNNER_ARCH=${{ steps.tags.outputs.arch }} \ + --file Dockerfile-bookworm . + - name: Push + run: | + docker push ${{ steps.tags.outputs.image }}:${{ steps.tags.outputs.tag }} + build-amd64: + strategy: + matrix: + version: [ 2.311.0 ] + arch: [ amd64 ] + runs-on: [ linux, amd64 ] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set tags + id: tags + run: | + echo "arch=${{ matrix.arch }}" >> $GITHUB_OUTPUT + echo "runner=${{ matrix.version }}" >> $GITHUB_OUTPUT + echo "image=ghcr.io/${{ github.repository_owner }}/runner-image-${{ matrix.arch }}" >> $GITHUB_OUTPUT echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - name: Login uses: docker/login-action@v3 @@ -37,7 +69,8 @@ jobs: docker push ${{ steps.tags.outputs.image }}:${{ steps.tags.outputs.tag }} manifest: needs: - - build + - build-arm64 + - build-amd64 runs-on: ubuntu-latest steps: - name: Set tags @@ -54,13 +87,10 @@ jobs: - name: Create Manifest run: | docker manifest create ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \ - --amend ${{ steps.tags.outputs.manifest }}-arm:${{ steps.tags.outputs.tag }} \ --amend ${{ steps.tags.outputs.manifest }}-arm64:${{ steps.tags.outputs.tag }} --amend ${{ steps.tags.outputs.manifest }}-amd64:${{ steps.tags.outputs.tag }} docker manifest annotate --arch arm64 ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \ ${{ steps.tags.outputs.manifest }}-arm64:${{ steps.tags.outputs.tag }} - docker manifest annotate --arch arm ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \ - ${{ steps.tags.outputs.manifest }}-arm:${{ steps.tags.outputs.tag }} docker manifest annotate --arch amd64 ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }} \ ${{ steps.tags.outputs.manifest }}-amd64:${{ steps.tags.outputs.tag }} docker manifest push ${{ steps.tags.outputs.manifest }}:${{ steps.tags.outputs.tag }}