Skip to content

Commit

Permalink
only build for linux/amd64 on PRs (#2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh authored May 30, 2023
1 parent 80204f0 commit 971b9f4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ jobs:
- if: github.event_name != 'pull_request'
run: gcloud auth configure-docker

# Don't build for all platforms on PRs.
- id: platforms
run: |
event="${{ github.event_name }}"
if [[ "$event" == "pull_request" ]]; then
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
else
platforms="${{ matrix.platforms }}"
echo "platforms=${platforms}" >> $GITHUB_OUTPUT
fi
# Build and push with Docker.
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
with:
Expand All @@ -82,7 +92,7 @@ jobs:
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
platforms: ${{ steps.platforms.outputs.platforms }}
push: ${{ github.event_name != 'pull_request' }} # Only push if not a PR.
tags: ${{ matrix.image-name }}:${{ matrix.tag }}
no-cache-filters: certs
Expand Down

0 comments on commit 971b9f4

Please sign in to comment.