From 0f3da49c1f96d8dc1fdad4518837453918b8311b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kenneth=20Wu=C3=9Fmann?= Date: Sun, 18 Feb 2024 13:40:33 +0100 Subject: [PATCH] Revert "Build on native runners (#41)" This reverts commit 57d99fb5cb51bc70c80d8013275faf04a80e15fe. --- .github/actions/docker-publish/action.yml | 19 ++++++---- .github/workflows/release-docker-develop.yml | 33 ++--------------- .github/workflows/release-docker-latest.yml | 37 ++------------------ 3 files changed, 19 insertions(+), 70 deletions(-) diff --git a/.github/actions/docker-publish/action.yml b/.github/actions/docker-publish/action.yml index e122d3a..5cd0227 100644 --- a/.github/actions/docker-publish/action.yml +++ b/.github/actions/docker-publish/action.yml @@ -2,16 +2,16 @@ name: docker-publish description: Publish the Docker image to GH Container Registry inputs: githubToken: - description: "Token to access private GH Docker registry" + description: 'Token to access private GH Docker registry' required: true tags: - description: "Tags to assign for the published docker container" + description: 'Tags to assign for the published docker container' required: true build-args: - description: "Build args" + description: 'Build args' required: false runs: - using: "composite" + using: 'composite' steps: - name: Login to GitHub Packages Docker Registry uses: docker/login-action@v2 @@ -19,9 +19,16 @@ runs: username: ${{ github.repository_owner }} password: ${{ inputs.githubToken }} registry: ghcr.io - - name: Build and push + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@master + - name: Build and push multi-arch uses: docker/build-push-action@v4 with: push: true + platforms: linux/amd64,linux/arm64 tags: ${{ inputs.tags }} - build-args: ${{ inputs.build-args }} + build-args: ${{ inputs.build-args }} \ No newline at end of file diff --git a/.github/workflows/release-docker-develop.yml b/.github/workflows/release-docker-develop.yml index 948472a..452f214 100644 --- a/.github/workflows/release-docker-develop.yml +++ b/.github/workflows/release-docker-develop.yml @@ -11,15 +11,8 @@ env: FORCE_COLOR: 1 jobs: - build: - runs-on: ${{ matrix.runner }} - strategy: - matrix: - include: - - runner: buildjet-8vcpu-ubuntu-2204-arm - arch: arm64 - - runner: buildjet-8vcpu-ubuntu-2204 - arch: amd64 + release: + runs-on: buildjet-8vcpu-ubuntu-2204-arm permissions: packages: write contents: read @@ -31,25 +24,5 @@ jobs: - uses: ./.github/actions/docker-publish with: githubToken: ${{ secrets.GITHUB_TOKEN }} - tags: ghcr.io/kennethwussmann/tory:${{ matrix.arch }}-${{ steps.git-commit.outputs.SHORT_SHA }} + tags: ghcr.io/kennethwussmann/tory:develop,ghcr.io/kennethwussmann/tory:${{ steps.git-commit.outputs.SHORT_SHA }} build-args: VERSION=${{ steps.git-commit.outputs.SHORT_SHA }} - - create-and-push-manifest: - needs: build - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - name: Login to GitHub Packages Docker Registry - uses: docker/login-action@v3 - with: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - - name: Create and push Docker manifest - run: | - docker manifest create ghcr.io/kennethwussmann/tory:develop \ - --amend ghcr.io/kennethwussmann/tory:amd64-${{ needs.build.outputs.SHORT_SHA }} \ - --amend ghcr.io/kennethwussmann/tory:arm64-${{ needs.build.outputs.SHORT_SHA }} - docker manifest push ghcr.io/kennethwussmann/tory:develop diff --git a/.github/workflows/release-docker-latest.yml b/.github/workflows/release-docker-latest.yml index 31d6ec7..bd9280f 100644 --- a/.github/workflows/release-docker-latest.yml +++ b/.github/workflows/release-docker-latest.yml @@ -11,15 +11,8 @@ env: FORCE_COLOR: 1 jobs: - build: - runs-on: ${{ matrix.runner }} - strategy: - matrix: - include: - - runner: buildjet-8vcpu-ubuntu-2204-arm - arch: arm64 - - runner: buildjet-8vcpu-ubuntu-2204 - arch: amd64 + release: + runs-on: buildjet-8vcpu-ubuntu-2204-arm permissions: packages: write contents: read @@ -31,29 +24,5 @@ jobs: - uses: ./.github/actions/docker-publish with: githubToken: ${{ secrets.GITHUB_TOKEN }} - tags: ghcr.io/kennethwussmann/tory:${{ matrix.arch }}-${{ steps.vars.outputs.tag }} + tags: ghcr.io/kennethwussmann/tory:${{ steps.vars.outputs.tag }},ghcr.io/kennethwussmann/tory:latest build-args: VERSION=${{ steps.vars.outputs.tag }} - - create-and-push-manifest: - needs: build - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - name: Login to GitHub Packages Docker Registry - uses: docker/login-action@v2 - with: - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - - name: Create and push Docker manifest - run: | - docker manifest create ghcr.io/kennethwussmann/tory:${{ needs.build.outputs.tag }} \ - --amend ghcr.io/kennethwussmann/tory:amd64-${{ needs.build.outputs.tag }} \ - --amend ghcr.io/kennethwussmann/tory:arm64-${{ needs.build.outputs.tag }} - docker manifest push ghcr.io/kennethwussmann/tory:${{ needs.build.outputs.tag }} - docker manifest create ghcr.io/kennethwussmann/tory:latest \ - --amend ghcr.io/kennethwussmann/tory:amd64-${{ needs.build.outputs.tag }} \ - --amend ghcr.io/kennethwussmann/tory:arm64-${{ needs.build.outputs.tag }} - docker manifest push ghcr.io/kennethwussmann/tory:latest