Skip to content

Commit 327cd5a

Browse files
authored
Merge pull request #838 from crazy-max/bake-v6
update bake-action to v6
2 parents 7ca3450 + e217ef3 commit 327cd5a

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

.github/workflows/test.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ jobs:
1515
test:
1616
runs-on: ubuntu-latest
1717
steps:
18-
-
19-
name: Checkout
20-
uses: actions/checkout@v4
2118
-
2219
name: Test
23-
uses: docker/bake-action@v5
20+
uses: docker/bake-action@v6
2421
with:
2522
targets: test
2623
-

.github/workflows/validate.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ jobs:
1515
prepare:
1616
runs-on: ubuntu-latest
1717
outputs:
18-
targets: ${{ steps.targets.outputs.matrix }}
18+
targets: ${{ steps.generate.outputs.targets }}
1919
steps:
2020
-
2121
name: Checkout
2222
uses: actions/checkout@v4
2323
-
24-
name: Targets matrix
25-
id: targets
26-
run: |
27-
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
24+
name: List targets
25+
id: generate
26+
uses: docker/bake-action/subaction/list-targets@v6
27+
with:
28+
target: validate
2829

2930
validate:
3031
runs-on: ubuntu-latest
@@ -35,11 +36,8 @@ jobs:
3536
matrix:
3637
target: ${{ fromJson(needs.prepare.outputs.targets) }}
3738
steps:
38-
-
39-
name: Checkout
40-
uses: actions/checkout@v4
4139
-
4240
name: Validate
43-
uses: docker/bake-action@v5
41+
uses: docker/bake-action@v6
4442
with:
4543
targets: ${{ matrix.target }}

docker-bake.hcl

+13
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
}
@@ -11,42 +17,49 @@ group "validate" {
1117
}
1218

1319
target "build" {
20+
inherits = ["_common"]
1421
dockerfile = "dev.Dockerfile"
1522
target = "build-update"
1623
output = ["."]
1724
}
1825

1926
target "build-validate" {
27+
inherits = ["_common"]
2028
dockerfile = "dev.Dockerfile"
2129
target = "build-validate"
2230
output = ["type=cacheonly"]
2331
}
2432

2533
target "format" {
34+
inherits = ["_common"]
2635
dockerfile = "dev.Dockerfile"
2736
target = "format-update"
2837
output = ["."]
2938
}
3039

3140
target "lint" {
41+
inherits = ["_common"]
3242
dockerfile = "dev.Dockerfile"
3343
target = "lint"
3444
output = ["type=cacheonly"]
3545
}
3646

3747
target "vendor" {
48+
inherits = ["_common"]
3849
dockerfile = "dev.Dockerfile"
3950
target = "vendor-update"
4051
output = ["."]
4152
}
4253

4354
target "vendor-validate" {
55+
inherits = ["_common"]
4456
dockerfile = "dev.Dockerfile"
4557
target = "vendor-validate"
4658
output = ["type=cacheonly"]
4759
}
4860

4961
target "test" {
62+
inherits = ["_common"]
5063
dockerfile = "dev.Dockerfile"
5164
target = "test-coverage"
5265
output = ["./coverage"]

0 commit comments

Comments
 (0)