diff --git a/.github/workflows/docker-buid-publish.yml b/.github/workflows/docker-buid-publish.yml index e8db2f7..8c9cd03 100644 --- a/.github/workflows/docker-buid-publish.yml +++ b/.github/workflows/docker-buid-publish.yml @@ -71,8 +71,9 @@ jobs: # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - - name: Build and push Docker image + - name: Build and push Docker image with cache id: build-and-push + if: github.event_name != 'schedule' || startsWith(github.ref, 'refs/tags/v') != true uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: context: . @@ -81,7 +82,20 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push without cache + id: build-and-push-nocache + if: github.event_name == 'schedule' && startsWith(github.ref, 'refs/tags/v') == true + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + no-cache-filters: build + cache-from: type=gha + cache-to: type=gha,mode=max # Sign the resulting Docker image digest except on PRs. # This will only write to the public Rekor transparency log when the Docker # repository is public to avoid leaking data. If you would like to publish