Skip to content

Commit

Permalink
build: add multi-arch image (#46)
Browse files Browse the repository at this point in the history
This PR reuses upstream Buildx Bake configuration to build multi-arch
images for registry.

Resolves: #45 

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
  • Loading branch information
qweeah authored Dec 7, 2022
1 parent 3b2b14f commit 0b094d5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/oras-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
workflow_dispatch:

jobs:
publish:
Expand Down Expand Up @@ -46,14 +47,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: setup_buildx

- name: Build image
if: ${{ success() }}
uses: docker/build-push-action@v2
uses: docker/bake-action@v1
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
flavor: latest=auto
files: |
./docker-bake.hcl
targets: image-all
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ steps.get_image_tag.outputs.docker_tag }}
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest
set: |
image-all.tags=${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ steps.get_image_tag.outputs.docker_tag }}
image-all.tags=${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest

0 comments on commit 0b094d5

Please sign in to comment.