Specify build features #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cspell:word imagetools | |
# cspell:word onlatest | |
--- | |
jobs: | |
build-push: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: 'actions/checkout@v4' | |
- run: 'git submodule update --init --recursive src/rust/processor' | |
- id: 'metadata' | |
uses: 'docker/metadata-action@v5' | |
with: | |
images: 'econialabs/emojicoin-dot-fun-indexer-broker' | |
tags: | | |
type=match,pattern=broker-v(.*),group=1 | |
- id: 'arm64-metadata' | |
uses: 'docker/metadata-action@v5' | |
with: | |
flavor: | | |
suffix=-arm64,onlatest=true | |
images: 'econialabs/emojicoin-dot-fun-indexer-broker' | |
tags: | | |
type=match,pattern=broker-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: 'Push AMD image to Docker Hub' | |
uses: 'docker/build-push-action@v6' | |
with: | |
build-args: 'FEATURES=ws' | |
cache-from: 'type=gha' | |
cache-to: 'type=gha,mode=max' | |
context: 'src/rust' | |
file: 'src/rust/broker/Dockerfile' | |
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: 'Push ARM image to Docker Hub' | |
uses: 'docker/build-push-action@v6' | |
with: | |
build-args: 'FEATURES=ws' | |
cache-from: 'type=gha' | |
cache-to: 'type=gha,mode=max' | |
context: 'src/rust' | |
file: 'src/rust/broker/Dockerfile' | |
platforms: 'linux/arm64' | |
push: 'true' | |
tags: '${{ steps.arm64-metadata.outputs.tags }}' | |
- name: 'Append ARM images to AMD manifest' | |
run: | | |
echo "${{ steps.metadata.outputs.tags }}" | while read -r tag; do | |
if [ ! -z "$tag" ]; then | |
docker buildx imagetools create --append -t "$tag" "${tag}-arm64" | |
fi | |
done | |
timeout-minutes: 360 | |
name: 'Push multi-platform processor image to Docker Hub' | |
'on': | |
push: | |
tags: | |
- 'broker-v*' | |
... |