From fbd0e1cc3e519a20da6ff92cd5a387b72e210eea Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 2 Jan 2023 00:45:43 +0100 Subject: workflows/ci: don't build for ARM on every commit --- .github/workflows/ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09ff4a7..33d7302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: lint: runs-on: ubuntu-latest name: Linting - if: github.ref == 'refs/heads/master' + continue-on-error: ${{ github.ref != 'refs/heads/master' }} steps: - name: Checkout uses: actions/checkout@v2 @@ -73,7 +73,6 @@ jobs: project: [client, server] runs-on: ubuntu-latest name: 'Docker: publish math-${{ matrix.project }}' - if: github.ref == 'refs/heads/master' steps: - name: Checkout uses: actions/checkout@v2 @@ -88,10 +87,19 @@ jobs: with: username: '${{ secrets.DOCKERHUB_USERNAME }}' password: '${{ secrets.DOCKERHUB_TOKEN }}' + - id: platforms + name: Which platforms? + # Building for ARM for every commit not in master is too time-consuming. + run: | + if [ '${{ github.ref }}' = 'refs/heads/master' ]; then + echo 'platforms=linux/amd64,linux/armhf' >> "$GITHUB_OUTPUT" + else + echo 'platforms=linux/amd64' >> "$GITHUB_OUTPUT" + fi - name: 'Publish math-${{ matrix.project }}' uses: docker/build-push-action@v2 with: file: '${{ matrix.project }}/Dockerfile' - platforms: linux/amd64,linux/armhf - push: true + platforms: '${{ steps.platforms.outputs.platforms }}' + push: ${{ github.ref == 'refs/heads/master' }} tags: '${{ secrets.DOCKERHUB_USERNAME }}/math-${{ matrix.project }}:latest' -- cgit v1.2.3