Skip to content

Change manifest create style #36

Change manifest create style

Change manifest create style #36

Workflow file for this run

---
jobs:
build-push:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v4'
- id: 'metadata'
uses: 'docker/metadata-action@v5'
with:
images: 'econialabs/emojicoin-dot-fun-indexer-processor'
tags: |
type=match,pattern=emojicoin-processor-v(.*),group=1
- uses: 'docker/setup-qemu-action@v3'
- uses: 'docker/setup-buildx-action@v3'
- uses: 'docker/login-action@v3'
with:
password: '${{ secrets.DOCKERHUB_TOKEN }}'
username: '${{ secrets.DOCKERHUB_USERNAME }}'
- name: 'Build AMD image, push to Docker Hub, and store locally'
uses: 'docker/build-push-action@v6'
with:
cache-from: 'type=gha'
cache-to: 'type=gha,mode=max'
context: 'rust'
file: 'rust/Dockerfile'
outputs: 'type=docker,dest=/tmp/amd64.tar'
platforms: 'linux/amd64'
push: 'true'
tags: '${{ steps.metadata.outputs.tags }}'
- name: 'Clear Docker cache to free up space for ARM build'
run: 'docker system prune -af'
- name: 'Build ARM image and store locally'
uses: 'docker/build-push-action@v6'
with:
cache-from: 'type=gha'
cache-to: 'type=gha,mode=max'
context: 'rust'
file: 'rust/Dockerfile'
outputs: 'type=docker,dest=/tmp/arm64.tar'
platforms: 'linux/arm64'
push: 'false'
tags: '${{ steps.metadata.outputs.tags }}'
- uses: 'docker/login-action@v3'
with:
password: '${{ secrets.DOCKERHUB_TOKEN }}'
username: '${{ secrets.DOCKERHUB_USERNAME }}'
- name: 'Push multi-platform image to Docker Hub'
run: |
docker system prune -af
echo "=== Loading AMD64 image ==="
docker load --input /tmp/amd64.tar
AMD64_ID=$(docker images -q | head -n1)
docker tag $AMD64_ID temp-amd64:latest
echo "AMD64 image details:"
docker inspect temp-amd64:latest
echo "=== Loading ARM64 image ==="
docker load --input /tmp/arm64.tar
ARM64_ID=$(docker images -q | grep -v $AMD64_ID | head -n1)
docker tag $ARM64_ID temp-arm64:latest
echo "ARM64 image details:"
docker inspect temp-arm64:latest
echo "=== Current images ==="
docker images
echo "${{ secrets.DOCKERHUB_TOKEN }}" | \
docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
echo "${{ steps.metadata.outputs.tags }}" | while read -r tag; do
if [ ! -z "$tag" ]; then
echo "=== Creating multi-arch image for $tag ==="
echo "Source images:"
docker inspect temp-amd64:latest
docker inspect temp-arm64:latest
echo "=== Running buildx imagetools create ==="
docker buildx imagetools create \
--debug \
--progress=plain \
-t "$tag" \
--platform linux/amd64,linux/arm64 \
temp-amd64:latest \
temp-arm64:latest
echo "=== Attempting to inspect created image ==="
docker buildx imagetools inspect "$tag"
fi
done
timeout-minutes: 360
name: 'Push multi-platform processor image to Docker Hub'
'on':
push:
tags:
- 'emojicoin-processor-v*'
...