From 86b8b301f1ada9a8533c2324a3c6d416ec1d0949 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Sat, 29 Mar 2025 13:54:10 +0100 Subject: [PATCH] ci: update bake-action to v6 --- .github/workflows/validate.yml | 16 +++++++--------- docker-bake.hcl | 8 ++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1a6a7ca..fb57cb7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -19,16 +19,17 @@ jobs: prepare: runs-on: ubuntu-latest outputs: - targets: ${{ steps.targets.outputs.matrix }} + targets: ${{ steps.generate.outputs.targets }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Targets matrix - id: targets - run: | - echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT + name: List targets + id: generate + uses: docker/bake-action/subaction/list-targets@v6 + with: + target: validate validate: runs-on: ubuntu-latest @@ -39,11 +40,8 @@ jobs: matrix: target: ${{ fromJson(needs.prepare.outputs.targets) }} steps: - - - name: Checkout - uses: actions/checkout@v4 - name: Validate - uses: docker/bake-action@v5 + uses: docker/bake-action@v6 with: targets: ${{ matrix.target }} diff --git a/docker-bake.hcl b/docker-bake.hcl index ba82526..208fb1e 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,9 @@ +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["build"] } @@ -17,6 +23,7 @@ target "build" { } target "build-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-validate" output = ["type=cacheonly"] @@ -41,6 +48,7 @@ target "vendor" { } target "vendor-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-validate" output = ["type=cacheonly"]