Skip to content

Commit 41e77d1

Browse files
committed
perf: add platform parameter to setup-docker-buildx
1 parent efc5708 commit 41e77d1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/az_acr_push.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
DEV_LOGIN_PASSWORD: ${{ secrets.DEV_LOGIN_PASSWORD }}
1818
strategy:
1919
matrix:
20-
platform: [amd64, arm64/v8]
20+
platform: [amd64, arm64]
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
@@ -26,6 +26,8 @@ jobs:
2626

2727
- name: Set up Docker Buildx
2828
uses: docker/setup-buildx-action@v3
29+
with:
30+
platforms: linux/${{ matrix.platform }}
2931

3032
- name: Log into Azure registry
3133
uses: docker/login-action@v3
@@ -46,26 +48,26 @@ jobs:
4648
id: branch_name
4749
run: echo "GH_REF_NAME=$(echo ${{ github.ref_name }} | sed 's|/|-|g')" >> $GITHUB_OUTPUT
4850

49-
- name: Build & Push ${{ github.event.repository.name }}:${{ matrix.platform == 'arm64/v8' && 'arm64' || 'amd64' }}-${{ steps.branch_name.outputs.GH_REF_NAME }}
51+
- name: Build & Push ${{ github.event.repository.name }}:${{ matrix.platform }}-${{ steps.branch_name.outputs.GH_REF_NAME }}
5052
if: ${{ github.ref_name != github.repository.default_branch }}
5153
uses: docker/build-push-action@v5
5254
with:
5355
push: true
5456
file: 'Dockerfile'
55-
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ matrix.platform == 'arm64/v8' && 'arm64' || 'amd64' }}-${{ steps.branch_name.outputs.GH_REF_NAME }}
57+
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ matrix.platform }}-${{ steps.branch_name.outputs.GH_REF_NAME }}
5658
cache-from: type=gha
5759
cache-to: type=gha,mode=max
5860
build-args: |
5961
platform=linux/${{ matrix.platform }}
6062
label=dockerfile-path=https://github.com/${{ github.repository }}/blob/${{ github.sha }}/Dockerfile
6163
62-
- name: Build & Push ${{ github.event.repository.name }}:${{ matrix.platform == 'arm64/v8' && 'arm64' || 'amd64' }}-gpu
64+
- name: Build & Push ${{ github.event.repository.name }}:${{ matrix.platform }}-gpu
6365
if: ${{ hashFiles('gpu.Dockerfile') != '' }}
6466
uses: docker/build-push-action@v5
6567
with:
6668
push: true
6769
file: 'gpu.Dockerfile'
68-
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ matrix.platform == 'arm64/v8' && 'arm64' || 'amd64' }}-gpu
70+
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ matrix.platform }}-gpu
6971
cache-from: type=gha
7072
cache-to: type=gha,mode=max
7173
build-args: |

0 commit comments

Comments
 (0)