Skip to content

Commit 058a889

Browse files
committed
CI: Part 4 optimization
1 parent c9bb7be commit 058a889

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
# Only run if the Go build workflow succeeded
1919
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2020
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
platform: [linux/amd64, linux/arm64]
2124
steps:
2225
- name: Checkout code
2326
uses: actions/checkout@v3
@@ -28,18 +31,18 @@ jobs:
2831
- name: Set up Docker Buildx
2932
uses: docker/setup-buildx-action@v2
3033

31-
- name: Download AMD64 Artifact
32-
uses: actions/download-artifact@v4
33-
with:
34-
name: sanitizetelebot-linux-amd64
35-
github-token: ${{ secrets.GITHUB_TOKEN }}
36-
run-id: ${{ github.event.workflow_run.id }}
37-
path: bin
34+
- name: Get architecture
35+
id: platform
36+
run: |
37+
# Extract architecture from platform string
38+
echo "arch=${platform#*/}" >> $GITHUB_OUTPUT
39+
env:
40+
platform: ${{ matrix.platform }}
3841

39-
- name: Download ARM64 Artifact
42+
- name: Download Binary
4043
uses: actions/download-artifact@v4
4144
with:
42-
name: sanitizetelebot-linux-arm64
45+
name: sanitizetelebot-linux-${{ steps.platform.outputs.arch }}
4346
github-token: ${{ secrets.GITHUB_TOKEN }}
4447
run-id: ${{ github.event.workflow_run.id }}
4548
path: bin
@@ -57,8 +60,8 @@ jobs:
5760
uses: docker/build-push-action@v4
5861
with:
5962
context: .
60-
platforms: linux/amd64,linux/arm64
63+
platforms: ${{ matrix.platform }}
6164
push: true
6265
tags: ${{ env.IMAGE_NAME }}:latest
6366
build-args: |
64-
APP_BINARY=bin/sanitizetelebot-linux-${TARGETARCH}
67+
APP_BINARY=bin/sanitizetelebot-linux-${{ steps.platform.outputs.arch }}

0 commit comments

Comments
 (0)