docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.11k stars 527 forks source link

action rebuilding default image unnecessarily #997

Closed PhilipDeegan closed 8 months ago

PhilipDeegan commented 8 months ago

Contributing guidelines

I've found a bug, and:

Description

I'm building multiple images in a GHA matrix, when building/pushing the non-default image, it for some reason builds the default image

I don't expect this really, it should just try to push the tag given

I understand I might not have things setup properly, but, maybe I do also

Expected behaviour

Not build default images when pushing non-default images

Actual behaviour

builds default images when pushing non-default images

Repository URL

https://github.com/PHARCHIVE/phare_gha_dep_images

Workflow run URL

https://github.com/PHARCHIVE/phare_gha_dep_images/actions/runs/6761300518/job/18376042161

YAML workflow

name: CMake Ubuntu

on:
  pull_request:
  workflow_dispatch:

jobs:

  build:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      max-parallel: 4
      matrix:
        images: ['gcc:12.3.0', 'gcc:13.2.0']

    steps:
    - uses: actions/checkout@v3

    - name: Build
      run: chmod +x build.sh && ./build.sh ${{ matrix.images }}

    - uses: docker/login-action@v3
      with:
        registry: ghcr.io
        username: ${{ secrets.GCHR_USERNAME }}
        password: ${{ secrets.GCHR_TOKEN }}

    - uses: docker/build-push-action@v5
      with:
        push: true
        tags: ghcr.io/pharchive/phare_debian_dep/${{ matrix.images }}

Workflow logs

No response

BuildKit logs

No response

Additional info

No response

PhilipDeegan commented 8 months ago

I will try thishttps://github.com/docker/build-push-action/issues/538