diff options
| -rw-r--r-- | .github/workflows/ci.yml | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 549eaa4..6495393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: needs: [test] runs-on: ubuntu-latest name: 'Publish: Docker Hub' - if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') steps: - name: Checkout uses: actions/checkout@v6 @@ -46,7 +45,20 @@ jobs: uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 + - id: params + name: Push? Which platforms? + # Building for ARM for every commit not in master is too time-consuming. + run: | + if ${{ github.ref == 'refs/heads/master' }}; then + echo 'push=true' >> "$GITHUB_OUTPUT" + echo 'platforms=amd64,armhf,arm64' >> "$GITHUB_OUTPUT" + else + echo 'push=false' >> "$GITHUB_OUTPUT" + echo 'platforms=amd64' >> "$GITHUB_OUTPUT" + fi - name: Login to Docker Hub + # https://github.com/orgs/community/discussions/163013 + if: steps.params.outputs.push == 'true' uses: docker/login-action@v4 with: username: '${{ secrets.DOCKERHUB_USERNAME }}' @@ -58,6 +70,6 @@ jobs: # https://stackoverflow.com/a/74552407/514684 context: . labels: '${{ steps.meta.outputs.labels }}' - platforms: amd64,armhf,arm64 - push: true + platforms: '${{ steps.params.outputs.platforms }}' + push: '${{ steps.params.outputs.push }}' tags: '${{ steps.meta.outputs.tags }}' |
