aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-01-02 00:45:43 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-01-02 00:49:06 +0100
commitfbd0e1cc3e519a20da6ff92cd5a387b72e210eea (patch)
treecf0d8cac1c94221777d49632d0c5b3b9e2fd2d7b
parentworkflows/ci: disable scheduled runs (diff)
downloadmath-server-fbd0e1cc3e519a20da6ff92cd5a387b72e210eea.tar.gz
math-server-fbd0e1cc3e519a20da6ff92cd5a387b72e210eea.zip
workflows/ci: don't build for ARM on every commit
-rw-r--r--.github/workflows/ci.yml16
1 files changed, 12 insertions, 4 deletions
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'