Skip to content

Commit 6f50bbb

Browse files
authored
Merge pull request #353 from crazy-max/bake-v6
ci: update bake-action to v6
2 parents 5206100 + 9598ac2 commit 6f50bbb

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ jobs:
2626
uses: actions/checkout@v4
2727
-
2828
name: Test
29-
uses: docker/bake-action@v5
29+
uses: docker/bake-action@v6
3030
with:
31+
source: .
3132
targets: test
3233
-
3334
name: Upload coverage

.github/workflows/validate.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ jobs:
2121
prepare:
2222
runs-on: ubuntu-latest
2323
outputs:
24-
targets: ${{ steps.targets.outputs.matrix }}
24+
targets: ${{ steps.generate.outputs.targets }}
2525
steps:
2626
-
2727
name: Checkout
2828
uses: actions/checkout@v4
2929
-
30-
name: Targets matrix
31-
id: targets
32-
run: |
33-
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
30+
name: List targets
31+
id: generate
32+
uses: docker/bake-action/subaction/list-targets@v6
33+
with:
34+
target: validate
3435

3536
validate:
3637
runs-on: ubuntu-latest
@@ -41,11 +42,8 @@ jobs:
4142
matrix:
4243
target: ${{ fromJson(needs.prepare.outputs.targets) }}
4344
steps:
44-
-
45-
name: Checkout
46-
uses: actions/checkout@v4
4745
-
4846
name: Validate
49-
uses: docker/bake-action@v5
47+
uses: docker/bake-action@v6
5048
with:
5149
targets: ${{ matrix.target }}

docker-bake.hcl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
target "_common" {
2+
args = {
3+
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
4+
}
5+
}
6+
17
group "default" {
28
targets = ["build"]
39
}
@@ -17,6 +23,7 @@ target "build" {
1723
}
1824

1925
target "build-validate" {
26+
inherits = ["_common"]
2027
dockerfile = "dev.Dockerfile"
2128
target = "build-validate"
2229
output = ["type=cacheonly"]
@@ -41,6 +48,7 @@ target "vendor" {
4148
}
4249

4350
target "vendor-validate" {
51+
inherits = ["_common"]
4452
dockerfile = "dev.Dockerfile"
4553
target = "vendor-validate"
4654
output = ["type=cacheonly"]

0 commit comments

Comments
 (0)