Skip to content

Commit

Permalink
Revert "Build on native runners (#41)"
Browse files Browse the repository at this point in the history
This reverts commit 57d99fb.
  • Loading branch information
KennethWussmann authored Feb 18, 2024
1 parent 57d99fb commit 0f3da49
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 70 deletions.
19 changes: 13 additions & 6 deletions .github/actions/docker-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ 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
with:
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 }}
33 changes: 3 additions & 30 deletions .github/workflows/release-docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
37 changes: 3 additions & 34 deletions .github/workflows/release-docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 0f3da49

Please sign in to comment.