diff --git a/README.md b/README.md index e94aeeb..254e3c4 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ GitHub Action to install [QEMU](https://github.com/qemu/qemu) static binaries. ___ * [Usage](#usage) + * [Multi-platform build example](#multi-platform-build-example) * [Customizing](#customizing) * [inputs](#inputs) * [outputs](#outputs) @@ -48,6 +49,43 @@ jobs: > uses: docker/setup-buildx-action@v4 > ``` +### Multi-platform build example + +The following example shows how to use this action to build and push a multi-platform image for `linux/amd64` and `linux/arm64` using [Buildx](https://github.com/docker/buildx): + +```yaml +name: ci + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v4 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: user/app:latest + platforms: linux/amd64,linux/arm64 +``` + ## Customizing ### inputs