Skip to content

Use GitHub hosted ARM runners 🤖 #265

Use GitHub hosted ARM runners 🤖

Use GitHub hosted ARM runners 🤖 #265

Workflow file for this run

# Based on https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
name: Build and Publish Docker Images
on:
push:
branches:
- '**'
jobs:
build-bot-x86:
name: Build Bot (x86)
runs-on: ubuntu-24.04
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
if: github.event_name != 'push' || github.actor != 'dependabot[bot]'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: build
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'push' || github.actor != 'dependabot[bot]' }}
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-x86
# Disabled for reasons discussed in https://github.com/docker/build-push-action/issues/820
provenance: false
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest
cache-to: type=inline
build-bot-arm:
name: Build Bot (ARM)
runs-on: ubuntu-24.04-arm
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
if: github.event_name != 'push' || github.actor != 'dependabot[bot]'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: build
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
push: ${{ github.event_name != 'push' || github.actor != 'dependabot[bot]' }}
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-arm
# Disabled for reasons discussed in https://github.com/docker/build-push-action/issues/820
provenance: false
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:latest
cache-to: type=inline
merge-and-push-bot:
name: Merge and Push Bot
if: github.event_name != 'push' || github.actor != 'dependabot[bot]'
needs:
- build-bot-x86
- build-bot-arm
runs-on: ubuntu-24.04
steps:
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: metadata
name: Docker Image Metadata
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}},priority=1100
type=ref,event=branch
type=ref,event=pr
type=sha,prefix=
- name: Create and Push Docker Manifests
uses: int128/docker-manifest-create-action@v2
with:
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
sources: |
ghcr.io/${{ github.repository }}@${{ needs.build-bot-x86.outputs.digest }}
ghcr.io/${{ github.repository }}@${{ needs.build-bot-arm.outputs.digest }}
push: true
build-stt-x86:
name: Build STT (x86)
runs-on: ubuntu-24.04
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
if: github.event_name != 'push' || github.actor != 'dependabot[bot]'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: build
name: Build and push
uses: docker/build-push-action@v6
with:
context: ./stt
platforms: linux/amd64
push: ${{ github.event_name != 'push' || github.actor != 'dependabot[bot]' }}
tags: ghcr.io/${{ github.repository }}/stt:${{ github.sha }}-x86
# Disabled for reasons discussed in https://github.com/docker/build-push-action/issues/820
provenance: false
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/stt:latest
cache-to: type=inline
build-stt-arm:
name: Build STT (ARM)
runs-on: ubuntu-24.04-arm
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
if: github.event_name != 'push' || github.actor != 'dependabot[bot]'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: build
name: Build and push
uses: docker/build-push-action@v6
with:
context: ./stt
platforms: linux/arm64
push: ${{ github.event_name != 'push' || github.actor != 'dependabot[bot]' }}
tags: ghcr.io/${{ github.repository }}/stt:${{ github.sha }}-arm
# Disabled for reasons discussed in https://github.com/docker/build-push-action/issues/820
provenance: false
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/stt:latest
cache-to: type=inline
merge-and-push-stt:
name: Merge and Push STT
if: github.event_name != 'push' || github.actor != 'dependabot[bot]'
needs:
- build-stt-x86
- build-stt-arm
runs-on: ubuntu-24.04
steps:
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: metadata
name: Docker Image Metadata
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/stt
tags: |
type=raw,value=latest,enable={{is_default_branch}},priority=1100
type=ref,event=branch
type=ref,event=pr
type=sha,prefix=
- name: Create and Push Docker Manifests
uses: int128/docker-manifest-create-action@v2
with:
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
sources: |
ghcr.io/${{ github.repository }}/stt@${{ needs.build-stt-x86.outputs.digest }}
ghcr.io/${{ github.repository }}/stt@${{ needs.build-stt-arm.outputs.digest }}
push: true