From 911cdbeab59c384fd0d6a4a1773e9f5a2effa1dc Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 16 Oct 2021 17:10:30 +0300 Subject: workflows/ci: don't build containers for ARM on every commit --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7416e5b..8003b13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,10 +87,19 @@ jobs: with: username: '${{ secrets.DOCKERHUB_USERNAME }}' password: '${{ secrets.DOCKERHUB_TOKEN }}' + - id: platforms + name: Which platforms? + # Building for ARM for every commit in master is too time-consuming. + run: | + if [ '${{ github.ref }}' = 'refs/heads/master' ]; then + echo '::set-output name=platforms::linux/amd64' + else + echo '::set-output name=platforms::linux/amd64,linux-armhf' + fi - name: Build and publish uses: docker/build-push-action@v2 with: - platforms: linux/amd64,linux/armhf + platforms: '${{ steps.platforms.outputs.platforms }}' push: true tags: '${{ steps.meta.outputs.tags }}' labels: '${{ steps.meta.outputs.labels }}' -- cgit v1.2.3