Skip to content

multiarch2

multiarch2 #4

name: multiarch2
on:
# push:
workflow_dispatch:
env:
REGISTRY_IMAGE: mwader/static-ffmpeg:test
jobs:
build:
strategy:
matrix:
include:
- runs_on: ubicloud-standard-8-arm
tag: image:arm64
- runs_on: ubuntu-latest
tag: image:amd64
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
push: false
tags: ${{ matrix.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Save Docker image
run: docker image save --output image-${{ matrix.tag }}.tar image
- name: Upload Docker image-${{ matrix.tag }}
uses: actions/upload-artifact@v4
with:
name: image-${{ matrix.tag }}
path: image-${{ matrix.tag }}.tar
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: image-*
merge-multiple: true
- name: Load Docker images
run:
docker image load --input image-arm64.tar
docker image load --input image-amd64.tar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
--tag ${{ env.REGISTRY_IMAGE }} \
image:arm64 image:amd64
- name: Inspect image
run: |
docker buildx imagetools inspect {{ $env.REGISTRY_IMAGE }}