Skip to content

buildx-xx

buildx-xx #3

Workflow file for this run

name: buildx-xx
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: '1.6.1'
latest_version:
required: true
type: boolean
default: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
-
name: Checkout source
uses: actions/checkout@v4
with:
repository: loong64/xx
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 DockerHub
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 }}
echo "full_tag=${full_tag}" >> $GITHUB_ENV
echo "latest_tag=${full_tag}" >> $GITHUB_ENV
if [ "${{ github.event.inputs.latest_version }}" = "true" ]; then
echo "latest_tag=latest" >> $GITHUB_ENV
fi
-
name: Build and push bats-assert
uses: docker/build-push-action@v6
if: github.event.inputs.latest_version
with:
context: util/bats-assert/
platforms: linux/loong64
push: true
build-args: |
BUILDPLATFORM=linux/loong64
tags: |
ghcr.io/${{ github.repository_owner }}/bats-assert:latest
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
cache-from: type=gha
cache-to: type=gha,mode=max
-
name: Build and push xx
uses: docker/build-push-action@v6
with:
context: src/
platforms: linux/loong64
push: true
build-args: |
BUILDPLATFORM=linux/loong64
tags: |
ghcr.io/${{ github.repository_owner }}/xx:${{ env.full_tag }}
ghcr.io/${{ github.repository_owner }}/xx:${{ env.latest_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