only build for linux/amd64 on PRs (#2460)

This commit is contained in:
Jason Hall
2023-05-30 15:30:58 -07:00
committed by GitHub
parent 80204f0c7a
commit 971b9f48a0
+11 -1
View File
@@ -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:
@@ -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