Skip to content

Commit 7247675

Browse files
committed
update bake-action to v6
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 906ecf0 commit 7247675

File tree

4 files changed

+27
-52
lines changed

4 files changed

+27
-52
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,12 @@ jobs:
392392
type=sha
393393
-
394394
name: Build
395-
uses: docker/bake-action@v5
395+
uses: docker/bake-action@v6
396396
with:
397397
files: |
398398
./test/docker-bake.hcl
399-
${{ steps.docker_meta.outputs.bake-file-tags }}
400-
${{ steps.docker_meta.outputs.bake-file-labels }}
399+
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
400+
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
401401
targets: |
402402
release
403403
@@ -504,12 +504,12 @@ jobs:
504504
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
505505
-
506506
name: Build
507-
uses: docker/bake-action@v5
507+
uses: docker/bake-action@v6
508508
with:
509509
files: |
510510
./test/docker-bake.hcl
511-
${{ steps.docker_meta.outputs.bake-file-tags }}
512-
${{ steps.docker_meta.outputs.bake-file-annotations }}
511+
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
512+
cwd://${{ steps.docker_meta.outputs.bake-file-annotations }}
513513
targets: |
514514
release
515515
@@ -539,7 +539,7 @@ jobs:
539539
name: Print envs
540540
run: env|sort
541541

542-
bake-cwd:
542+
bake-path-context:
543543
runs-on: ubuntu-latest
544544
steps:
545545
-
@@ -556,13 +556,13 @@ jobs:
556556
uses: ./
557557
-
558558
name: Build
559-
uses: docker/bake-action@v5
559+
uses: docker/bake-action@v6
560560
with:
561-
source: "{{defaultContext}}"
561+
source: .
562562
files: |
563563
./test/docker-bake.hcl
564-
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
565-
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
564+
${{ steps.docker_meta.outputs.bake-file-tags }}
565+
${{ steps.docker_meta.outputs.bake-file-labels }}
566566
targets: |
567567
release
568568

.github/workflows/test.yml

Lines changed: 1 addition & 4 deletions
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

Lines changed: 7 additions & 9 deletions
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 }}

README.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ jobs:
206206
docker:
207207
runs-on: ubuntu-latest
208208
steps:
209-
-
210-
name: Checkout
211-
uses: actions/checkout@v4
212209
-
213210
name: Docker meta
214211
id: meta
@@ -224,11 +221,11 @@ jobs:
224221
type=sha
225222
-
226223
name: Build
227-
uses: docker/bake-action@v5
224+
uses: docker/bake-action@v6
228225
with:
229226
files: |
230227
./docker-bake.hcl
231-
${{ steps.meta.outputs.bake-file }}
228+
cwd://${{ steps.meta.outputs.bake-file }}
232229
targets: build
233230
```
234231

@@ -271,29 +268,12 @@ similar to the previous one:
271268
```yaml
272269
-
273270
name: Build
274-
uses: docker/bake-action@v5
271+
uses: docker/bake-action@v6
275272
with:
276273
files: |
277274
./docker-bake.hcl
278-
${{ steps.meta.outputs.bake-file-tags }}
279-
${{ steps.meta.outputs.bake-file-labels }}
280-
targets: build
281-
```
282-
283-
If you're building a [remote Bake definition](https://docs.docker.com/build/bake/remote-definition/)
284-
using a [Git context](https://github.com/docker/bake-action?tab=readme-ov-file#git-context),
285-
you must specify the location of the metadata-only bake file using a `cwd://`
286-
prefix:
287-
288-
```yaml
289-
-
290-
name: Build
291-
uses: docker/bake-action@v5
292-
with:
293-
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
294-
files: |
295-
./docker-bake.hcl
296-
cwd://${{ steps.meta.outputs.bake-file }}
275+
cwd://${{ steps.meta.outputs.bake-file-tags }}
276+
cwd://${{ steps.meta.outputs.bake-file-labels }}
297277
targets: build
298278
```
299279

@@ -1008,12 +988,12 @@ The same can be done with the [`bake-action`](https://github.com/docker/bake-act
1008988
images: name/app
1009989
-
1010990
name: Build
1011-
uses: docker/bake-action@v5
991+
uses: docker/bake-action@v6
1012992
with:
1013993
files: |
1014994
./docker-bake.hcl
1015-
${{ steps.meta.outputs.bake-file-tags }}
1016-
${{ steps.meta.outputs.bake-file-annotations }}
995+
cwd://${{ steps.meta.outputs.bake-file-tags }}
996+
cwd://${{ steps.meta.outputs.bake-file-annotations }}
1017997
targets: build
1018998
```
1019999

0 commit comments

Comments
 (0)