Skip to content

buildx-binfmt

buildx-binfmt #6

Workflow file for this run

name: buildx-binfmt
on:
workflow_dispatch:
inputs:
source-tag:
description: 'binfmt source Docker tag'
required: true
default: 'patch_loong64'
full-tag:
description: 'binfmt full Docker tag'
required: true
default: 'v8.1.5-41'
jobs:
build:
runs-on: ubuntu-24.04
steps:
-
name: Checkout source
uses: actions/checkout@v4
with:
repository: loong64/binfmt
ref: ${{ github.event.inputs.source-tag }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Setup QEMU
run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Prepare environment
run: |
full_tag=${{ github.event.inputs.full-tag }}
major_tag=${full_tag%%-*}
echo "full_tag=$full_tag" >> $GITHUB_ENV
echo "major_tag=$major_tag" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/loong64
push: true
build-args: |
BUILDPLATFORM=linux/loong64
tags: |
ghcr.io/${{ github.repository_owner }}/binfmt:${{ env.full_tag }}
ghcr.io/${{ github.repository_owner }}/binfmt:${{ env.major_tag }}
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
cache-from: type=gha
cache-to: type=gha,mode=max