Skip to content

Commit

Permalink
feat(docker): support build multi platform image
Browse files Browse the repository at this point in the history
  • Loading branch information
DeKaiju committed Aug 15, 2024
1 parent db19dc6 commit ca0aa22
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/docker-acr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*"

jobs:
build-n-publish-to-ecr:
build-image-push-to-aliyun:
runs-on: ubuntu-latest

steps:
Expand All @@ -15,12 +15,7 @@ jobs:
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: Checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ">=1.17.0"
uses: actions/checkout@v4

- name: Login to ACR
uses: aliyun/acr-login@v1
Expand All @@ -31,10 +26,15 @@ jobs:
access-key-secret: "${{ secrets.ALI_ACCESS_KEY_SECRET }}"
instance-id: "cri-a4wmsz77ru5o7hub"

- name: Build, tag, and push docker image to ACR
env:
REGISTRY: chainbase-registry.ap-southeast-1.cr.aliyuncs.com/network
REPOSITORY: chainbase-node
IMAGE_TAG: ${{ steps.get_version.outputs.VERSION }}
run: |
docker buildx build --platform linux/amd64,linux/arm64 -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . && docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: chainbase-registry.ap-southeast-1.cr.aliyuncs.com/network/chainbase-node:${{ steps.get_version.outputs.VERSION }}

0 comments on commit ca0aa22

Please sign in to comment.