Skip to content

Commit 4910da7

Browse files
csenetclaude
andcommitted
Build amd64 and arm64 in parallel with native runners
- Use ubuntu-22.04-arm for native arm64 builds (no QEMU) - Run amd64 and arm64 builds in parallel - Keep short SHA format (7 chars) for image tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a9cb55d commit 4910da7

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

.github/workflows/image-build.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,11 @@ env:
1111
jobs:
1212
build-amd64:
1313
runs-on: ubuntu-latest
14-
outputs:
15-
image_tag: ${{ steps.tag.outputs.IMAGE_TAG }}
1614
steps:
1715
- uses: actions/checkout@v4
1816
- uses: docker/setup-buildx-action@v3
1917
- name: Set tag
20-
id: tag
21-
run: |
22-
export TIMESTAMP=$(date +%s)
23-
export SHA=$(echo ${{ github.sha }} | cut -c1-7)
24-
echo "IMAGE_TAG=$SHA-$TIMESTAMP" >> $GITHUB_OUTPUT
25-
echo "IMAGE_TAG=$SHA-$TIMESTAMP" >> $GITHUB_ENV
18+
run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c1-7)-${{ github.run_id }}" >> $GITHUB_ENV
2619
- name: Login to GitHub Container Registry
2720
uses: docker/login-action@v3
2821
with:
@@ -42,12 +35,11 @@ jobs:
4235

4336
build-arm64:
4437
runs-on: ubuntu-22.04-arm
45-
needs: build-amd64
46-
env:
47-
IMAGE_TAG: ${{ needs.build-amd64.outputs.image_tag }}
4838
steps:
4939
- uses: actions/checkout@v4
5040
- uses: docker/setup-buildx-action@v3
41+
- name: Set tag
42+
run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c1-7)-${{ github.run_id }}" >> $GITHUB_ENV
5143
- name: Login to GitHub Container Registry
5244
uses: docker/login-action@v3
5345
with:
@@ -68,9 +60,9 @@ jobs:
6860
merge:
6961
runs-on: ubuntu-latest
7062
needs: [build-amd64, build-arm64]
71-
env:
72-
IMAGE_TAG: ${{ needs.build-amd64.outputs.image_tag }}
7363
steps:
64+
- name: Set tag
65+
run: echo "IMAGE_TAG=$(echo ${{ github.sha }} | cut -c1-7)-${{ github.run_id }}" >> $GITHUB_ENV
7466
- name: Login to GitHub Container Registry
7567
uses: docker/login-action@v3
7668
with:

0 commit comments

Comments
 (0)