Skip to content

Commit 6084731

Browse files
ci: limit linux/arm64 builds to pushes to main to reduce build times on PRs
1 parent 6d93c26 commit 6084731

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/build-cli-docker.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,24 @@ jobs:
8585
echo "tags=$_AZ_REGISTRY/bws:${IMAGE_TAG}" >> $GITHUB_OUTPUT
8686
fi
8787
88+
# it takes significantly longer to build for the linux/arm64 platform,
89+
# so we only build for both platforms on pushes to main
90+
- name: Set build targets based on workflow trigger
91+
id: platforms
92+
run: |
93+
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
94+
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
95+
else
96+
echo "platforms=linux/amd64,linux/arm64/v8" >> $GITHUB_OUTPUT
97+
fi
98+
8899
- name: Build and push Docker image
89100
id: build-docker
90101
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
91102
with:
92103
context: .
93104
file: crates/bws/Dockerfile
94-
platforms: |
95-
linux/amd64,
96-
linux/arm64/v8
105+
platforms: ${{ steps.platforms.outputs.platforms }}
97106
push: true
98107
tags: ${{ steps.tag-list.outputs.tags }}
99108
secrets: |

0 commit comments

Comments
 (0)